From: <var...@us...> - 2009-01-19 21:16:32
|
Revision: 6417 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6417&view=rev Author: vargenau Date: 2009-01-19 21:16:25 +0000 (Mon, 19 Jan 2009) Log Message: ----------- Allow single-line Wikicreole plugins Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-19 10:49:42 UTC (rev 6416) +++ trunk/lib/InlineParser.php 2009-01-19 21:16:25 UTC (rev 6417) @@ -855,12 +855,22 @@ var $_match_regexp = '<\?plugin(?:-form)?\s[^\n]+?\?>'; function markup ($match) { - //$xml = new Cached_PluginInvocation($match); - //$xml->setTightness(true,true); return new Cached_PluginInvocation($match); } } +// Special version for single-line Wikicreole plugins formatting. +class Markup_plugin_wikicreole extends SimpleMarkup +{ + var $_match_regexp = '<<[^\n]+?>>'; + + function markup ($match) { + $pi = str_replace("<<", "<?plugin ", $match); + $pi = str_replace(">>", " ?>", $pi); + return new Cached_PluginInvocation($pi); + } +} + // Special version for plugins in xml syntax // <name arg=value>body</name> or <name /> => < ? plugin pluginname arg=value body ? > // PLUGIN_MARKUP_MAP = "html:RawHtml dot:GraphViz toc:CreateToc amath:AsciiMath richtable:RichTable include:IncludePage tex:TexToPng" @@ -1056,7 +1066,7 @@ 'wikicreole_italics', 'wikicreole_bold', 'wikicreole_monospace', 'wikicreole_superscript', 'wikicreole_subscript', 'old_emphasis', 'nestled_emphasis', - 'html_emphasis', 'html_abbr', 'plugin', + 'html_emphasis', 'html_abbr', 'plugin', 'plugin_wikicreole', 'isonumchars', 'isohexchars', /*'html_entities'*/ ); if (DISABLE_MARKUP_WIKIWORD) @@ -1199,7 +1209,7 @@ function NowikiTransformer () { $this->InlineTransformer (array('linebreak', - 'html_emphasis', 'html_abbr', 'plugin', + 'html_emphasis', 'html_abbr', 'plugin', 'plugin_wikicreole', 'isonumchars', 'isohexchars', /*'html_entities',*/ )); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |