[pmwiki-users] non-HTML markup (was: <div> markup suggestions)

John Rankin john.rankin at affinity.co.nz
Tue Mar 1 15:27:54 CST 2005


On Tuesday, 1 March 2005 3:03 PM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>Well, one way of catching any that are missed might be to simply
>report any markups that haven't been registered or blessed into the 
>DTD.  For example, if we revised AltMarkup() to read:
>
>    AltMarkup('xyz', 'id1', 'output');
>    AltMarkup('xyz', 'id2');
>
>the second form could indicate that 'id2' is known to be valid in
>the 'xyz' DTD, but otherwise generates the same output as the default
>(xhtml).  Then it's a fairly easy matter to identify any markups in the
>table that don't have corresponding 'xyz' DTD entries.

After a bit of discussion, a couple of comments and suggestions:
    AltMarkup('xyz', 'id1', '/match/', 'output');

Adding the match pattern, perhaps as an optional parameter, would:
- make the code more self-documenting for complex outputs

- prevent the code from breaking if the original match pattern changes

- possibly be able to give a warning if the original and alt match
  patterns are different

This is an excellent suggestion:
    AltMarkup('xyz', 'id2');

Perhaps add:
    UnregisteredAltMarkup('xyz', '/match/', output);

For example:
    UnregisteredAltMarkup('xyz', '/<.*?>/', '');

This would strip any xhtml markup from the output of unregistered 
wiki markups for the xyz dtd.

Then when debugging, we might write:
    UnregisteredAltMarkup('xyz', '/<(.*?)>/', '&lt;$1&gt;');

We could even make these bold and underlined so they stand out for
debugging purposes...



-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list