I have been looking closer into the markup code and done more testing, and found this provisional solution:
For DisableMarkup to work from within a function called by a markup expression or directive (working on inline markup) I had to change the following: function MarkupToHTML(): no changes. it was not necessary to move $markrules = BuildMarkupRules(); into the while(count($lines)>0) loop function BuildMarkupRules(): add unset($MarkupRules); to the beginning. remove line if (!$MarkupRules) { and the closing } before the return $MarkupRules; Basically $MarkupRules needed to be unset. I wonder though why it should be a global at all, the function does return the markup rules without it being global. function DisableMarkup(): remove line unset($MarkupRules); This line does not work anyway, as the var is not declared global, and it would make no difference if it were. For Markup() to work from within a function, to redefine an existing one, I needed to do these changes: function Markup(): change line if ($pat && !isset($MarkupTable[$id]['pat'])) { to if ($pat) { Otherwise a modified pattern will not be registered, as it already exists. Please consider these changes. Hans _______________________________________________ pmwiki-devel mailing list pmwiki-devel@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-devel