<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 4, 2014 at 9:55 AM, Hans Bracker <span dir="ltr"><<a href="mailto:design@softflow.co.uk" target="_blank">design@softflow.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":49a" class="" style="overflow:hidden">Could  PmWiki  be more specific to identify in which function call and<br>
script offending regular expressions reside?</div></blockquote></div><br>What if pmwiki was distributed with 2 copies of pmwiki.php -- one the standard production version and the other pmwiki-debug.php.  In the case of a need for troubleshooting an admin would swap out the pmwiki.php with the pmwiki-debug.php (simply renaming appropriately) and then re-load the page.  The pmwiki-debug.php version could do various things to help debug:</div><div class="gmail_extra"><br></div><div class="gmail_extra">* The Markup() and Markup_e() functions could have an additional step of creating an array indexed by regex/replace strings and holding a "Scriptname.php: lineno" string.  Then when Petko's error is triggered it could include the script name and line #</div><div class="gmail_extra">* The "<span style="color:rgb(0,0,0);font-family:Arial,Helvetica,sans-serif;font-size:1.22em;line-height:19.5066661834717px">Debugging pmwiki rules" section of </span><font color="#000000" face="Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:19.5066661834717px"><a href="http://www.pmwiki.org/wiki/Cookbook/DebuggingForCookbookAuthors#rules">http://www.pmwiki.org/wiki/Cookbook/DebuggingForCookbookAuthors#rules</a> could be made available and turned on/off via some $Enable variable</span></font></div><div class="gmail_extra"><font color="#000000" face="Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:19.5066661834717px"><br></span></font></div><div class="gmail_extra"><font color="#000000" face="Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:19.5066661834717px">Come to think of it, both of those changes could be turned on/off by $EnableDebugMarkup and $EnableDebugRules variables rather than swapping different version of pmwiki.php (oh, for the presence of an #ifdef preprocessor in PHP!)...  </span></font></div><div class="gmail_extra"><br></div><div class="gmail_extra">The presence of these 2 changes would be of GREAT value in troubleshooting.  The first greatly enhances the error message and the second allows you to see in great detail exactly which rule is causing the undesired behavior.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-Peter</div></div>