On Fri, Oct 26, 2012 at 10:29 PM, W Randolph Franklin
<pkw...@wrfranklin.org> wrote:
>...
> On 10/26/12 14:34, Peter Bowers wrote:
>> On Fri, Oct 26, 2012 at 6:19 PM, W Randolph Franklin
>> <pmw...@wrfranklin.org> wrote:
>>>
>> ...
>>> Markup('^>>', '<table',
>>>   '/^&gt;&gt;(.+?)&lt;&lt;(.*)$/',
>>>   '(:div:)%div $1 apply=div%$2 ');
>>> Markup('^>><<', '<^>>',
>>>   '/^&gt;&gt;&lt;&lt;/',
>>>   '(:divend:)');
>>>
>>> My questions:
>>>
>>> 1. Why is &gt; 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 &gt; and < to &lt; 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

_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to