Dom,<br><br>Thank you. That was very helpful and got me on my way to making this work...<br><br>-- Harry<br><br><br><br><div><span class="gmail_quote">On 2/7/07, <b class="gmail_sendername">Dominique Faure</b> <<a href="mailto:dominique.faure@gmail.com">
dominique.faure@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 2/7/07, Harry Forsdick <<a href="mailto:harry@forsdick.com">
harry@forsdick.com</a>> wrote:<br>> I have mastered some parts of extending pmWiki markup, but there is one<br>> simple case that I can't seem to get to work.<br>><br>> In a travelog that has navigation between pages, I have been laboriously
<br>> copying the same code at the top and bottom of each pakge and then modifying<br>> it so that there is a previous day and next day link. The wiki code is<br>> something like:<br>><br>> ||[[Main.MonFeb05|
<- Monday, February 5]] || [[Main.WedFeb07|Wednesday,<br>> February 7 ->]]||<br>><br>> I have gotten tired of this copying and so I decided to create what I think<br>> of as a macro to generate the pmWiki language code from a short directive:
<br>><br>> (:navprevnext Feb6:)<br>><br>> the code that I have added to my config.php file is:<br>><br>> ## NAVPREVNEXT<br>> Markup('navprevnext', 'fulltext', '/\\(:navprevnext +(.*?):\\)/e',
<br>> "GenerateNavPrevNextCode('$1')");<br>> function GenerateNavPrevNextCode($DateStr)<br>> {<br>> $date = strtotime($DateStr);<br>> $prev = $date - 86400;<br>> $next = $date + 86400;
<br>><br>> $result = "||[[Main." . date("DMd",$prev) . "|<- " . date("l, F j", $prev)<br>> . "]] || [[Main." . date("DMd",$next) . "|" . date("l, F j", $next) . "
<br>> ->]]||";<br>><br>> return Keep($result);<br>> }<br>><br>> The problem is that the pmWiki markup appears, not the interpretation of the<br>> markup.<br>><br><br>The Keep() function prevent your computed result to be interpreted as
<br>further markup. You should have a try without it:<br><br> ...<br> return $result;<br>}<br><br>Dom<br></blockquote></div><br><br clear="all"><br>-- <br>Harry Forsdick<br>781.861.6149 (home) 781.799.6002 (cell)<br><a href="http://www.forsdick.com">
http://www.forsdick.com</a><br><a href="http://forsdick.blogspot.com">http://forsdick.blogspot.com</a><br><a href="http://www.lexdig.com">http://www.lexdig.com</a>