From: <ru...@us...> - 2009-06-04 11:26:16
|
Revision: 6865 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6865&view=rev Author: rurban Date: 2009-06-04 11:26:00 +0000 (Thu, 04 Jun 2009) Log Message: ----------- abbr|acronym need an optional title tag. sf.net bug #728595 do not hardcode /phpwiki path, use DATA_PATH Support ENABLE_MARKUP_MEDIAWIKI_TABLE Add Markup_wikicreoletable_plugin Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-06-04 11:22:23 UTC (rev 6864) +++ trunk/lib/InlineParser.php 2009-06-04 11:26:00 UTC (rev 6865) @@ -504,6 +504,7 @@ class Markup_bracketlink extends SimpleMarkup { var $_match_regexp = "\\#? \\[ .*? [^]\\s] .*? \\]"; + // TODO: include second ] in regexp function markup ($match) { $link = LinkBracketLink($match); @@ -816,7 +817,7 @@ //rurban: abbr|acronym need an optional title tag. //sf.net bug #728595 // allowed attributes: title and lang - var $_start_regexp = "<(?: abbr|acronym )(?: [^>]*)?>"; + var $_start_regexp = "<(?: abbr|acronym )(?: \s(?: title|lang)=[^>]*)?>"; function getEndRegexp ($match) { if (substr($match,1,4) == 'abbr') @@ -992,8 +993,7 @@ // It's not a Mediawiki template, it's a Wikicreole image if (is_image($imagename)) { if ($imagename[0] == '/') { - // We should not hardcode "/phpwiki" - return LinkImage(SERVER_URL . "/phpwiki" . $imagename, $alt); + return LinkImage(DATA_PATH . '/' . $imagename, $alt); } else { return LinkImage(getUploadDataPath() . $imagename, $alt); } @@ -1023,6 +1023,33 @@ } } +/** ENABLE_MARKUP_MEDIAWIKI_TABLE + * Table syntax similar to Mediawiki + * {| + * => <?plugin MediawikiTable + * |} + * => ?> + */ +class Markup_mediawikitable_plugin extends SimpleMarkup +{ + var $_match_regexp = '\{\|.*?\|\}'; + + function markup ($match) { + $s = '<'.'?plugin MediawikiTable ' . $match . '?'.'>'; + return new Cached_PluginInvocation($s); + } +} + +class Markup_wikicreoletable_plugin extends SimpleMarkup +{ + var $_match_regexp = '^\|=.*?\?>'; + + function markup ($match) { + $s = '<'.'?plugin WikicreoleTable ' . $match . '?'.'>'; + return new Cached_PluginInvocation($s); + } +} + // "..." => "…" browser specific display (not cached?) // Support some HTML::Entities: (C) for copy, --- for mdash, -- for ndash // TODO: "--" => "&emdash;" browser specific display (not cached?) @@ -1117,10 +1144,13 @@ $this->_addMarkup(new Markup_html_divspan); if (ENABLE_MARKUP_COLOR and !$non_default) $this->_addMarkup(new Markup_color); + $this->_addMarkup(new Markup_wikicreoletable_plugin); // Markup_wikicreole_preformatted must be before Markup_template_plugin $this->_addMarkup(new Markup_wikicreole_preformatted); 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) $this->_addMarkup(new Markup_xml_plugin); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |