I've recently gotten back to blogging on WordPress, after a gap of about 4 years where I exclusively used PmWiki for my web editing.<br>WP has some great features, but I hate both visual editor (almost any visual editor in any application) and the HTML editor. <br>

For one, the HTML is re-processed silently<br>Second, entering HTML is a damn'd nuisance.<br>Third, I'm much more used to PmWiki markup at this point.<br><br><br><br>So, I built a simple WordPress plugin to callout to PmWiki as a markup service, using the below code.<br>

Basically, the plugin checks for text enclosed by a set of tags, passes that to the markup service, which them provides HTML back to WordPress.<br><br>Despite the AuthUser and HandleAuth the markup service works on a lower level of authorization, and should any attempts at using an (:include AuthAccess.Only:) nothing is served up<br>

<br><br>Other than the simplicity and lack of nuance below (what few params currently exist are hard-coded), is this a bad idea?<br>Is there any major security hole that I'm opening up in PmWiki by doing this?<br><br>

<br>Since only text is returned, any default or themed css is not available,
 nor is any JavaScript that would have been added by cookbook recipes<br>
(On a side note, the number of recipes I use that don't make use of 
Unobtrusive JavaScript is annoying. I see a bunch of patching in my 
future)<br>
<br>Is there any way to obtain arbitrary JavaScript that extension attempt to add to the page? (other than inline JS applied to markup) ?<br><br><br>I like being able to do markup in a consistent manner across the two platforms I use.<br>

Although the loss of plugin and extension functionality on either side is disappointing.<br><br><br><?php if(!defined('PmWiki'))exit;<br><br>## custom action for markup service<br>## 2012.05.30<br>## Michael J. Paulukonis<br>

## <a href="http://www.xradiograph.com">http://www.xradiograph.com</a><br>##<br>## <a href="http://www.pmwiki.org/wiki/PmWiki/CustomActions">http://www.pmwiki.org/wiki/PmWiki/CustomActions</a><br>$HandleActions['wikimarkup'] = 'MarkupService';  # if url contains action=myaction call HandleMyAction timely<br>

## since this is an external call, how to handle authentication?<br>## can we pass it in via the params???<br>$AuthUser['wikimarkup'] = crypt('wikimarkup');<br>$HandleAuth['wikimarkup'] = 'admin';              # authorization level $auth for HandleMyAction<br>

<br>function MarkupService($pagename, $auth) {     # parameters (signature) of handler function required by PMWiki<br><br>  $wikitext = stripslashes($_GET['wikitext']);<br>  $pagename = 'WordPress.Post'; // just a place-holder, evaluate<br>

<br>  MarkupServiceOptions();<br><br>  $markup = MarkupToHTML($pagename, $wikitext);<br><br>  header('Content-type: text/html');<br>  echo $markup;<br><br>}<br><br>## eventually, we should be expose these options w/in WordPress<br>

## a mechanism to SetOnce, instead of always passing, might be good<br>## OTOH, always-passing means individual sections can have different markup<br>function MarkupServiceOptions() {<br><br>  global $LinkWikiWords, $SpaceWikiWords, $EnableUrlApprovalRequired;<br>

<br>        $LinkWikiWords = 0;  ## disable<br>        $SpaceWikiWords = 0; ## turn off WikiWord spacing<br>  $EnableUrlApprovalRequired = 0;<br>}<br><br><br clear="all">-Michael Paulukonis<br><a href="http://www.xradiograph.com" target="_blank">http://www.xradiograph.com</a><br>

<a href="http://goog_2112721603" target="_blank"></a><a href="http://www.xradiograph.com%5Cinterference" target="_blank">Interference Patterns (a blog)</a><br><a href="http://michaelpaulukonis.com" target="_blank">http://michaelpaulukonis.com</a><br>

<a href="http://www.BestAndroidResources.com" target="_blank"></a><br><br>Sent from somewhere in the Cloud<br>(hearthrug, by the fender)<br><br>