[pmwiki-users] Free markup character?
Allister Jenks
arj at zkarj.co.nz
Wed Apr 5 19:40:12 CDT 2006
On 4/6/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>
> By convention PmWiki has always explicitly reserved the '='
> character for custom markup sequences.
Excepting [= =] ??
> Can anybody educate me on why I broke >><< by defining ";", and/or
> suggest
> > a suitable markup I could implement?
> >
> > I had Markup("", "inline", "/;(.*?);/", "<span
> style='font-style:italic;
> > color:#0000c0;'>$1</span>");
>
> It's probably not the semicolon that broke the markup...there
> appear to be a couple of issues with the rule as written here:
>
> 1. Every markup needs a name; I don't know how PmWiki will
> react to using "" as a markup name. (I suspect not well at all.)
Unintentional and I didn't realise until you pointed it out. Oops!
2. Semicolons occur in lots of places other than markup text.
> In particular, the string you're using to replace ";(.*?);"
> contains a pair of semicolons itself. Since the replacement
> string isn't escaped or preserved in any way, the semicolon
> replacement pattern is probably being a bit over-eager and
> adding <span> around any pair of semicolons it may happen to find --
> even those that are coming from other HTML tags or other markups.
Ah the perils of knowing just enough to be dangerous! I must admit I was
only thinking of the marked up text as seen in source/edit view and not of
the generated HTML. I'll have a closer look at regex and try to tighten the
rule, and use something with an =.
This last point is similar to the reason why it's difficult to do a
> markup like /italic/ -- there are a lot of things that
> have slashes in them that aren't intended to be italics,
> such as urls (http://www.pmwiki.org/wiki/PmWiki), fractions (3/4),
> and/or, closing HTML tags such as </b>, </span>, etc.
Point well made.
Does this suggest the need for a page in the standard distribution which
somehow utilises *all* of the markup rules? Maybe that is to big an ask? I
would imagine only one sort of directive would be required, which would help
reduce the requirement.
See I was lucky in that to get to the page where I wanted to deploy the ; ;
markup I had to go through one with >><< which is what broke. If I hadn't I
don't know how long it would have taken me to stumble on the problem. By
having a page as described above, it would allow a quick comparison check to
see if anything had broken.
Just a thought.
--
Allister
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20060406/fb9bc33d/attachment.html
More information about the pmwiki-users
mailing list