I just checked how Pm did it.
Basically htmlspecialchars($x, ENT_NOQUOTES) is used on every text line as
part of the MarkupToHTML rendering process, before markup rules are applied
(done with  a helper function PVSE()). The effect is that besides '<' (which
may have been saved encoded as '&lt;' also '>' and '&' are htmlencoded.

But if I try soemthing like that in function BOLTdomarkup() before rules are
applied it messes up badly. The reason is (I think) that rules are applied
several times for the same text.

Try adding ca. line 752 echo $out; before line
   $out = preg_replace($rule['pattern'], $rule['replace'], $out);
You get a mass of repeats. Looks very inefficient (maybe some improvements
could be made there, but this is a different issue).
And makes it impossible to add at that point (before the rule application)
$out = htmlspecialchars($out, ENT_NOQUOTES);

But somewhere in the domarkuop process it should happen, and just once for
every text line, or the text. Perhaps after or before line
   $out = str_replace('$', '&#36;', $out);

Just tried that. Works well but doing it there you would need to adjust some
markup rules to check for &lt; and &gt; and &amp;
PmWiki markup rules do that consistently, since at thatppoint there won't be
any unencoded < > left.

~Hans

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to