<div>Peter, thanks for the reply. &nbsp;Unfortunately, your method doesn&#39;t seem to work quite correctly either. &nbsp;The method you specified (and several variations on it that I tried) works for suppressing the &quot;sop&quot; markup on pages that don&#39;t have &quot;(:sop:)&quot; specified, but it removes all sectioning on the pages on which &quot;(:sop:)&quot; is specified.</div>
<div><br></div><div>It still seems to me that the most straightforward and sensible way to do this is to allow a &quot;Markup()&quot; call &nbsp;within a &quot;Markup()&quot; call, but that doesn&#39;t seem to work.</div><div>
<br></div><div>So I&#39;m still banging my head over this one.</div><div><br></div><div>Scott</div><div>&nbsp;</div><br><br><div class="gmail_quote">On Sat, Feb 7, 2009 at 9:30 AM, Peter Bowers <span dir="ltr">&lt;<a href="mailto:pbowers@pobox.com">pbowers@pobox.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div class="Ih2E3d">On Fri, Feb 6, 2009 at 8:33 PM, Scott Diegel <span dir="ltr">&lt;<a href="mailto:scottdiegel@gmail.com" target="_blank">scottdiegel@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
I want a Markup() call to apply only to a given type of page, specifically if (:sop:) is included on a wiki page. &nbsp;The Markup will affect section numbering, but I still need the standard section markup to be used.<div><div>

<div><div></div></div></div></div></blockquote></div><div>... <br></div><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div>
<div><div><div>Loading the file in which this is defined via config.php results in the section formatting being changed for all pages. &nbsp;I tried the following, and checked using ?action=ruleset whether the &#39;sop&#39; rule was being applied; &#39;sopheaders&#39; is being applied, but &#39;sop&#39; is not.</div>


<div><br></div><div><span style="font-family:&#39;courier new&#39;,monospace">/*</span></div><div><span style="font-family:&#39;courier new&#39;,monospace">function SOPheaders(){</span></div>
<div><span style="white-space:pre"><span style="font-family:&#39;courier new&#39;,monospace">        </span></span><span style="font-family:&#39;courier new&#39;,monospace">Markup(&#39;sop&#39;,&#39;&gt;include&#39;,&#39;/^(!{2,4})(?:\s*)(.*)$/e&#39;, &quot;MkSopNumTitle(strlen(&#39;$1&#39;),PSS(&#39;$2&#39;))&quot;);</span></div>


<div><span style="white-space:pre"><span style="font-family:&#39;courier new&#39;,monospace">        </span></span><span style="font-family:&#39;courier new&#39;,monospace">}</span></div>
<div><span style="font-family:&#39;courier new&#39;,monospace">Markup(&#39;sopheaders&#39;,&#39;directives&#39;,&#39;/\\(:sop:\\)/e&#39;,&quot;SOPheaders()&quot;);</span></div><div><span style="font-family:&#39;courier new&#39;,monospace">*/</span></div>


<br></div><div>Is this the right approach? &nbsp;Is there another approach I can try?</div><div></div></div></div></blockquote></div><div><br>That looks fine to me.&nbsp; And if SOPheaders is always active but sop only active on the appropriate pages then that&#39;s exactly what you want, right?&nbsp; My only concern is whether a markup that gets defined *during* markup will get applied correctly (i.e., will it get put in the right order, etc. -- is all that done inside the Markup() function or is it done separately in pmwiki.php after config.php).&nbsp; I&#39;d say if it works then you&#39;ve got a great solution.<br>

<br>If, on the other hand, it&#39;s not working then this is what I would suggest:<br><br><div><span style="font-family:&#39;courier new&#39;,monospace">function </span><span style="font-family:&#39;courier new&#39;,monospace">MkSopNumTitle</span><span style="font-family:&#39;courier new&#39;,monospace">($arg1, $arg2, $MakeMeActive=false){</span></div>


<div><span style="white-space:pre"><span style="font-family:&#39;courier new&#39;,monospace">        static $MarkupActive = false;<br><br>    if ($MakeMeActive) {<br>        $MarkupActive = true;<br>        return(true);<br>
    }<br>    if (!$MarkupActive) return;<br><br></span></span><span style="font-family:&#39;courier new&#39;,monospace"></span></div>
<div><span style="white-space:pre"><span style="font-family:&#39;courier new&#39;,monospace"></span></span><span style="font-family:&#39;courier new&#39;,monospace"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... /* the rest of the code for MkSopNumTitle */<br>

}<br></div>
<div><div class="Ih2E3d"><div><span style="white-space:pre"><span style="font-family:&#39;courier new&#39;,monospace"></span></span><span style="font-family:&#39;courier new&#39;,monospace">Markup(&#39;sop&#39;,&#39;&gt;include&#39;,&#39;/^(!{2,4})(?:\s*)(.*)$/e&#39;, &quot;MkSopNumTitle(strlen(&#39;$1&#39;),PSS(&#39;$2&#39;))&quot;);</span></div>



<div><span style="white-space:pre"><span style="font-family:&#39;courier new&#39;,monospace"></span></span></div></div><span style="font-family:&#39;courier new&#39;,monospace">Markup(&#39;sopheaders&#39;,&#39;directives&#39;,&#39;/\\(:sop:\\)/e&#39;,&quot;</span><span style="font-family:&#39;courier new&#39;,monospace">MkSopNumTitle(false, false, true)</span><span style="font-family:&#39;courier new&#39;,monospace">&quot;);</span></div>

<br>However, your rule-based solution is superior as long as it actually works.&nbsp; It&#39;s better to not even have a rule to process when you don&#39;t need it...<br><br>-Peter <br></div></div>
</blockquote></div><br>