From: Marc-Etienne V. <var...@us...> - 2008-01-31 20:40:06
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29574/lib Modified Files: IniConfig.php InlineParser.php Log Message: Implemented Mediawiki-like syntax for tables Index: IniConfig.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/IniConfig.php,v retrieving revision 1.118 retrieving revision 1.119 diff -u -2 -b -p -d -r1.118 -r1.119 --- IniConfig.php 1 Sep 2007 13:24:23 -0000 1.118 +++ IniConfig.php 31 Jan 2008 20:40:10 -0000 1.119 @@ -197,4 +197,5 @@ function IniConfig($file) { 'ENABLE_WYSIWYG', 'WYSIWYG_DEFAULT_PAGETYPE_HTML', 'DISABLE_MARKUP_WIKIWORD', 'ENABLE_MARKUP_COLOR', 'ENABLE_MARKUP_TEMPLATE', + 'ENABLE_MARKUP_MEDIAWIKI_TABLE', 'ENABLE_MARKUP_DIVSPAN', 'USE_BYTEA', 'UPLOAD_USERDIR', 'DISABLE_UNITS', 'ENABLE_SEARCHHIGHLIGHT', 'DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS', @@ -941,4 +942,7 @@ function fixup_dynamic_configs($file) { // $Log$ +// Revision 1.119 2008/01/31 20:40:10 vargenau +// Implemented Mediawiki-like syntax for tables +// // Revision 1.118 2007/09/01 13:24:23 rurban // add INSECURE_ACTIONS_LOCALHOST_ONLY. advanced security settings Index: InlineParser.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/InlineParser.php,v retrieving revision 1.93 retrieving revision 1.94 diff -u -2 -b -p -d -r1.93 -r1.94 --- InlineParser.php 26 Sep 2007 16:54:34 -0000 1.93 +++ InlineParser.php 31 Jan 2008 20:40:10 -0000 1.94 @@ -821,4 +821,23 @@ class Markup_template_plugin extends Si } +/** ENABLE_MARKUP_MEDIAWIKI_TABLE + * Table syntax similar to mediawiki + * {| + * => <?plugin MediawikiTable + * |} + * => ?> + */ +class Markup_mediawikitable_plugin extends SimpleMarkup +{ + var $_match_regexp = '\{\|.*?\|\}'; + + function markup ($match) { + $s = str_replace("{|", "", $match); + $s = str_replace("|}", "", $s); + $s = '<?plugin MediawikiTable ' . $s . '?>'; + return new Cached_PluginInvocation($s); + } +} + // "..." => "…" browser specific display (not cached?) // Support some HTML::Entities: (C) for copy, --- for mdash, -- for ndash @@ -912,4 +931,6 @@ class InlineTransformer if (ENABLE_MARKUP_TEMPLATE and !$non_default) $this->_addMarkup(new Markup_template_plugin); + if (ENABLE_MARKUP_MEDIAWIKI_TABLE) + $this->_addMarkup(new Markup_mediawikitable_plugin); // This does not work yet if (0 and PLUGIN_MARKUP_MAP and !$non_default) @@ -1078,4 +1099,7 @@ function TransformInlineNowiki($text, $m // $Log$ +// Revision 1.94 2008/01/31 20:40:10 vargenau +// Implemented Mediawiki-like syntax for tables +// // Revision 1.93 2007/09/26 16:54:34 rurban // Fix Bug#1802827 Template does not get expanded with {{ }} syntax. |