[pmwiki-devel] [pmwiki-devel 63.1] Markup routine for style questions
Peter Bowers
pbowers at pobox.com
Sat Oct 27 13:20:57 CDT 2012
On Fri, Oct 26, 2012 at 10:29 PM, W Randolph Franklin
<pkwiki at wrfranklin.org> wrote:
>...
> On 10/26/12 14:34, Peter Bowers wrote:
>> On Fri, Oct 26, 2012 at 6:19 PM, W Randolph Franklin
>> <pmwiki at wrfranklin.org> wrote:
>>>
>> ...
>>> Markup('^>>', '<table',
>>> '/^>>(.+?)<<(.*)$/',
>>> '(:div:)%div $1 apply=div%$2 ');
>>> Markup('^>><<', '<^>>',
>>> '/^>><</',
>>> '(:divend:)');
>>>
>>> My questions:
>>>
>>> 1. Why is > used instead of > in the search pattern? Since the page
>>> being edited contains >, this should always fail.
>>
>> See htmlentities or htmlspecialchars. Typically in HTML putting < or
>>> signs will be interpreted as commands to HTML and so to avoid that
>> you use these special entities if you want to actually see a LT or GT
>> sign.
>
> My problem is as follows. I do know that, in html, you can use
> ampersand-lt-semicolon etc. They're converted by the html layout engine.
>
> However the file is still pmwiki code, not yet html. The pmwiki command
> in the file is two less-than chars. This markup rule should search for
> a pmwiki construct composed of two less-than chars. The fact that this
> markup routine, which is searching for two sets of
> ampersand-lt-semicolon chars, works is what puzzles me.
It all depends where the rule occurs in the order of rules. I don't
remember exactly which rule converts > to > and < to < and etc.
If you want to know which rule you can either code-read or else use
the final tip on
http://www.pmwiki.org/wiki/Cookbook/DebuggingForCookbookAuthors-Talk
to see what your text looks like between each rule. (Do note the
cautions there -- you get a HUGE log file pretty quickly...)
I think Petko covered everything else...
-Peter
More information about the pmwiki-devel
mailing list