<br><br><div><span class="gmail_quote">On 07/04/06, <b class="gmail_sendername">Octocias</b> &lt;<a href="mailto:octocias@googlemail.com">octocias@googlemail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="direction: ltr;"><br>I wish to create a custom markup which will insert WikiCode.<br><br>e.g. For instance, see the documented example:<br><br>Markup('example', 'directives',&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '/\\(:example:\\)/',&nbsp; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Keep(&quot;&lt;div class='example'&gt;&lt;p&gt;Here is a&nbsp;&nbsp;&nbsp;&nbsp; &lt;a target='_blank' href='
<a href="http://www.example.com%27" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.example.com'</a>&gt;link&lt;/a&gt; to&nbsp;&nbsp;&nbsp; &lt;em&gt;<a href="http://example.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
example.com</a>&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&quot;) );<br><br>This works fine, but how do I generate that text as wiki code?
<br><br>e.g. This is my starting code:<br><br>Usage: (:test sampletext:)<br><br>Markup('test', 'fulltext', '/\\(:test +(.*?):\\)/e', &quot;GenerateWikiCode('$1')&quot;);<br>function GenerateWikiCode($text) <br>{<br>&nbsp; $out = &quot;(:table border=5:)&quot;;
<br>&nbsp; $out .= &quot;(:cellnr:) Hey&quot;;<br>&nbsp; $out .= &quot;(:cell:) $text&quot;;<br>&nbsp; $out .= &quot;(:tableend:)&quot;;<br>  &nbsp; return Keep($out);<br>}<br><br>Is this clear? I want the php function to generate &quot;wiki code to be translated later to html&quot;.
<br><br>I can get it to work fine if I put the code into&nbsp; the markup directive, but I'd prefer to use the php function. Is this possible?  <br></div><div style="direction: ltr;"><span class="sg"><br>-- <br>Octocias<br><a href="http://www.octocias.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.octocias.com
</a>

</span></div></blockquote></div><br><br clear="all"><br>-- <br>Octocias<br><a href="http://www.octocias.com">http://www.octocias.com</a>