[pmwiki-users] styles in customMarkup
Petko Yotov
5ko at 5ko.fr
Sun Jan 24 11:05:55 CST 2010
On Sunday 24 January 2010 15:04:05, Walter Keller wrote :
> Markup('mRed', '>^>><<', '/{mRed\+}/', '>>color=red<<');
> then then the formatting is not honoured, just the text expanded to
> <<color ....
> To make it work you need the clumsy definition
> Markup('mBlue', '>^>><<', '/{mBlue\+}/', '>>color=blue<<');
>
> This is neither intuitive nor documented! It took me quite a time to
> find out. At least it would also work for text variables.
Feel free to document it on pmwiki.org on the pages where you think it should
be documented -- this may be helpful to other users. Thanks in advance.
> Could you fix pmWiki, such that '>>color=red<<' would work?
No. PmWiki converts the wiki-text to HTML which uses a lot the characters <
and >. In order not to mess with what it already processed to HTML, PmWiki
converts those characters < and > from the wiki source to the entities <
and >, and uses them when the page markup is processed. So it is correct,
if you define new markup rules containing < and >, which are not native HTML
but should be re-processed by PmWiki, you should use < and >.
Thanks,
Petko
P.S. If your use of the {mBlue} markup is really as simple as your example,
you know you can use the built-in %red% and %blue% command to change the text
to red and to blue.
More information about the pmwiki-users
mailing list