[pmwiki-users] Markup() Abuse Recommendations.

Patrick R. Michaud pmichaud at pobox.com
Mon Oct 23 14:20:32 CDT 2006


On Mon, Oct 23, 2006 at 03:15:02PM -0400, Stirling Westrup wrote:
> Patrick R. Michaud wrote:
> > On Mon, Oct 23, 2006 at 01:55:34PM -0400, Stirling Westrup wrote:
> >> Patrick R. Michaud wrote:
> 
> > Why would you be matching against <p ?  Is that to try to
> > match against paragraphs?  If so, that doesn't seem at all useful
> > or important at the 'directives' stage of processing, since paragraph
> > tags aren't added until the 'block' stage.
> 
> This is part of a demonstration that deals with people who've stuck
> <p>...</p> tags directly into the markup text.

Ah.  In this case, you need to be matching against '&lt;p'
instead of '<p', because the markup engine will have already
run htmlspecialchars() on the markup text.

> > And if it's only one or a few cases that result in the need for
> > testing zero-length assertions, then it might be worthwhile
> > to create special rules only for those, and combine the rest
> > into a single rule.
> 
> The problem is that the rule sets are generated programatically from a
> simple list and the analysis needed in order to find and deal with
> zero-length assertions is non-trivial, especially as they seem to appear
> in cases where the strict ordering of transformations becomes important.
> 
> For now, I will go with the current plan. I'll probably be posting the
> results as a recipe in a day or two (if I can fix a bug I'm having
> related to extended-ASCII characters), and it will be much easier then
> to judge if my approach is fundamentally flawed, overambitious, or what.

Sounds good, I look forward to it.  

Thanks,

Pm




More information about the pmwiki-users mailing list