From: <var...@us...> - 2008-10-30 11:08:25
|
Revision: 6339 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6339&view=rev Author: vargenau Date: 2008-10-30 11:08:19 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Update comments for isImageLink Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2008-10-28 15:58:27 UTC (rev 6338) +++ trunk/lib/InlineParser.php 2008-10-30 11:08:19 UTC (rev 6339) @@ -315,6 +315,7 @@ * Support for the following attributes: see stdlib.php:LinkImage() * size=<precent>%, size=<width>x<height> * border=n, align=\w+, hspace=n, vspace=n + * width=n, height=n */ function isImageLink($link) { if (!$link) return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-02 12:09:04
|
Revision: 6365 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6365&view=rev Author: vargenau Date: 2009-01-02 12:09:02 +0000 (Fri, 02 Jan 2009) Log Message: ----------- Implemented Wikicreole monospace Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-02 11:30:43 UTC (rev 6364) +++ trunk/lib/InlineParser.php 2009-01-02 12:09:02 UTC (rev 6365) @@ -609,6 +609,20 @@ } } +class Markup_wikicreole_monospace extends BalancedMarkup +{ + var $_start_regexp = "\\#\\#"; + + function getEndRegexp ($match) { + return "\\#\\#"; + } + + function markup ($match, $body) { + $tag = 'tt'; + return new HtmlElement($tag, $body); + } +} + class Markup_wikicreole_subscript extends BalancedMarkup { var $_start_regexp = ",,"; @@ -995,6 +1009,7 @@ $markup_types = array ('escape', 'wikicreolebracketlink', 'bracketlink', 'url', 'interwiki', 'semanticlink', 'wikiword', 'linebreak', + 'wikicreole_monospace', 'wikicreole_subscript', 'old_emphasis', 'nestled_emphasis', 'html_emphasis', 'html_abbr', 'plugin', 'isonumchars', 'isohexchars', /*'html_entities'*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-02 12:14:32
|
Revision: 6366 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6366&view=rev Author: vargenau Date: 2009-01-02 12:14:27 +0000 (Fri, 02 Jan 2009) Log Message: ----------- Implemented Wikicreole superscript Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-02 12:09:02 UTC (rev 6365) +++ trunk/lib/InlineParser.php 2009-01-02 12:14:27 UTC (rev 6366) @@ -622,7 +622,21 @@ return new HtmlElement($tag, $body); } } + +class Markup_wikicreole_superscript extends BalancedMarkup +{ + var $_start_regexp = "\\^\\^"; + function getEndRegexp ($match) { + return "\\^\\^"; + } + + function markup ($match, $body) { + $tag = 'sup'; + return new HtmlElement($tag, $body); + } +} + class Markup_wikicreole_subscript extends BalancedMarkup { var $_start_regexp = ",,"; @@ -1009,7 +1023,7 @@ $markup_types = array ('escape', 'wikicreolebracketlink', 'bracketlink', 'url', 'interwiki', 'semanticlink', 'wikiword', 'linebreak', - 'wikicreole_monospace', + 'wikicreole_monospace', 'wikicreole_superscript', 'wikicreole_subscript', 'old_emphasis', 'nestled_emphasis', 'html_emphasis', 'html_abbr', 'plugin', 'isonumchars', 'isohexchars', /*'html_entities'*/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-02 12:22:10
|
Revision: 6364 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6364&view=rev Author: vargenau Date: 2009-01-02 11:30:43 +0000 (Fri, 02 Jan 2009) Log Message: ----------- Finish implementing Wikicreole syntax for links Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-02 11:04:05 UTC (rev 6363) +++ trunk/lib/InlineParser.php 2009-01-02 11:30:43 UTC (rev 6364) @@ -470,10 +470,20 @@ } } +class Markup_wikicreolebracketlink extends SimpleMarkup +{ + var $_match_regexp = "\\#? \\[\\[ .*? [^]\\s] .*? \\]\\]"; + + function markup ($match) { + $link = LinkBracketLink($match); + assert($link->isInlineElement()); + return $link; + } +} + class Markup_bracketlink extends SimpleMarkup { var $_match_regexp = "\\#? \\[ .*? [^]\\s] .*? \\]"; - // TODO: include second ] in regexp function markup ($match) { $link = LinkBracketLink($match); @@ -983,7 +993,7 @@ if (!$markup_types) { $non_default = false; $markup_types = array - ('escape', 'bracketlink', 'url', + ('escape', 'wikicreolebracketlink', 'bracketlink', 'url', 'interwiki', 'semanticlink', 'wikiword', 'linebreak', 'wikicreole_subscript', 'old_emphasis', 'nestled_emphasis', 'html_emphasis', 'html_abbr', 'plugin', @@ -1118,7 +1128,7 @@ class LinkTransformer extends InlineTransformer { function LinkTransformer () { - $this->InlineTransformer(array('escape', 'bracketlink', 'url', + $this->InlineTransformer(array('escape', 'wikicreolebracketlink', 'bracketlink', 'url', 'semanticlink', 'interwiki', 'wikiword', )); } @@ -1184,145 +1194,6 @@ return $trfm->parse($text); } - -// $Log: not supported by cvs2svn $ -// Revision 1.106 2008/08/19 18:08:14 vargenau -// Implement Wikicreole syntax for tables -// -// Revision 1.105 2008/08/19 18:05:40 vargenau -// Implemented Wikicreole syntax for preformatted text -// -// Revision 1.104 2008/08/06 09:28:41 vargenau -// Allow header syntax in Mediawiki tables -// -// Revision 1.103 2008/08/03 16:18:35 vargenau -// Implement "{{foo?version=5}}" syntax for templates -// -// Revision 1.102 2008/08/03 16:03:47 vargenau -// Implement Wikicreole syntax for links -// -// Revision 1.101 2008/08/03 15:56:20 vargenau -// Implement Wikicreole syntax for line break -// -// Revision 1.100 2008/08/03 15:52:31 vargenau -// Implement Wikicreole syntax for subscript -// -// Revision 1.99 2008/05/06 19:23:17 rurban -// update (c) -// -// Revision 1.98 2008/03/21 20:35:52 rurban -// Improve upon embedded ImgObject, such as [ *.mp3 ], objects. -// Object tags now render as label correctly and param tags are also added. -// -// Revision 1.97 2008/03/18 20:25:49 rurban -// Fixed "\n" => " " in [ link parsing ] by suggestion of Marc-Etienne -// -// Revision 1.96 2008/03/17 19:06:39 rurban -// fix bug#1904088 Some brackets links with \n cause the parser to crash -// -// Revision 1.95 2008/02/15 20:02:49 vargenau -// Allow <s> to strike; update Help for <s> and <strike> -// -// 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. -// by vargenau -// -// Revision 1.92 2007/08/10 21:58:01 rurban -// Improve SemanticLink parsings: -// No units seperated by space allowed without [] -// For :: (relations) only words, no comma, -// but for := (attributes) comma and dots are allowed. Units with groupsep. -// Ending dots or comma are not part of the link. -// -// Revision 1.91 2007/06/07 18:56:57 rurban -// patch #1732793: allow \n, mult. {{ }} in one line, and single -// letters (slightly improved) by AlJeux and ReiniUrban -// -// Revision 1.90 2007/03/18 17:35:14 rurban -// Fix :DontStoreLink -// -// Revision 1.89 2007/02/17 14:16:28 rurban -// fix color GREY to GRAY -// -// Revision 1.88 2007/01/21 13:15:50 rurban -// Support spaces in attributes and relation links -// -// Revision 1.87 2007/01/20 15:53:51 rurban -// Rewrite of SearchHighlight: through ActionPage and InlineParser -// -// Revision 1.86 2007/01/20 11:25:07 rurban -// add SpellCheck support -// -// Revision 1.85 2007/01/07 18:42:49 rurban -// Add support for non-bracket semantic relation parsing. Assert empty regex (interwikimap?) earlier. Change {{Template||}} vars handling to new style. Stricter interwikimap matching not to find semantic links -// -// Revision 1.84 2007/01/02 13:18:07 rurban -// fix semantic attributes syntax :=, not :-, disable DIVSPAN and PLUGIN_MARKUP_MAP -// -// Revision 1.83 2006/12/22 00:23:24 rurban -// Fix Bug #1540007 "hardened-php issue, crawlers related" -// Broken str_replace with strings > 200 chars -// -// Revision 1.82 2006/12/02 19:53:05 rurban -// Simplify DISABLE_MARKUP_WIKIWORD handling by adding the new function -// stdlib: array_remove(). Hopefully PHP will not add this natively sooner -// or later. -// -// Revision 1.81 2006/11/19 13:52:52 rurban -// improve debug output: regex only once -// -// Revision 1.80 2006/10/12 06:32:30 rurban -// Optionally support new tags <div>, <span> with ENABLE_MARKUP_DIVSPAN (in work) -// -// Revision 1.79 2006/10/08 12:38:11 rurban -// New special interwiki link markup [:LinkTo] without storing the backlink -// -// Revision 1.78 2006/09/03 09:53:52 rurban -// more colors, case-insensitive color names -// -// Revision 1.77 2006/08/25 19:02:02 rurban -// patch #1348996 by Robert Litwiniec: fix show image semantics if label is given -// -// Revision 1.76 2006/08/19 11:02:35 rurban -// add strike and del to html emphasis: Patch #1542894 by Kai Krakow -// -// Revision 1.75 2006/08/15 13:43:10 rurban -// add Markup_xml_plugin (untested) and fix Markup_template_plugin -// -// Revision 1.74 2006/07/23 14:03:18 rurban -// add new feature: DISABLE_MARKUP_WIKIWORD -// -// Revision 1.73 2006/04/15 12:20:36 rurban -// fix relatives links patch by Joel Schaubert for [/ -// -// Revision 1.72 2006/03/07 20:43:29 rurban -// relative external link, if no internal subpage. by joel Schaubert -// -// Revision 1.71 2005/11/14 22:31:12 rurban -// add SemanticWeb support -// -// Revision 1.70 2005/10/31 16:45:23 rurban -// added cfg-able markups only for default TextTransformation, not for links and others -// -// Revision 1.69 2005/09/14 05:57:19 rurban -// make ENABLE_MARKUP_TEMPLATE optional -// -// Revision 1.68 2005/09/10 21:24:32 rurban -// optionally support {{Template|vars}} syntax -// -// Revision 1.67 2005/06/06 17:41:20 rurban -// support new ENABLE_MARKUP_COLOR -// -// Revision 1.66 2005/04/23 11:15:49 rurban -// handle allowed inlined objects within INLINE_IMAGES -// -// Revision 1.65 2005/03/27 18:24:17 rurban -// add Log -// - // (c-file-style: "gnu") // Local Variables: // mode: php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-02 12:22:51
|
Revision: 6367 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6367&view=rev Author: vargenau Date: 2009-01-02 12:22:48 +0000 (Fri, 02 Jan 2009) Log Message: ----------- Implemented Wikicreole italics Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-02 12:14:27 UTC (rev 6366) +++ trunk/lib/InlineParser.php 2009-01-02 12:22:48 UTC (rev 6367) @@ -609,6 +609,20 @@ } } +class Markup_wikicreole_italics extends BalancedMarkup +{ + var $_start_regexp = "\\/\\/"; + + function getEndRegexp ($match) { + return "\\/\\/"; + } + + function markup ($match, $body) { + $tag = 'em'; + return new HtmlElement($tag, $body); + } +} + class Markup_wikicreole_monospace extends BalancedMarkup { var $_start_regexp = "\\#\\#"; @@ -1023,6 +1037,7 @@ $markup_types = array ('escape', 'wikicreolebracketlink', 'bracketlink', 'url', 'interwiki', 'semanticlink', 'wikiword', 'linebreak', + 'wikicreole_italics', 'wikicreole_monospace', 'wikicreole_superscript', 'wikicreole_subscript', 'old_emphasis', 'nestled_emphasis', 'html_emphasis', 'html_abbr', 'plugin', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-02 12:31:27
|
Revision: 6368 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6368&view=rev Author: vargenau Date: 2009-01-02 12:31:22 +0000 (Fri, 02 Jan 2009) Log Message: ----------- Implemented Wikicreole bold Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-02 12:22:48 UTC (rev 6367) +++ trunk/lib/InlineParser.php 2009-01-02 12:31:22 UTC (rev 6368) @@ -623,6 +623,20 @@ } } +class Markup_wikicreole_bold extends BalancedMarkup +{ + var $_start_regexp = "\\*\\*"; + + function getEndRegexp ($match) { + return "\\*\\*"; + } + + function markup ($match, $body) { + $tag = 'strong'; + return new HtmlElement($tag, $body); + } +} + class Markup_wikicreole_monospace extends BalancedMarkup { var $_start_regexp = "\\#\\#"; @@ -1037,7 +1051,7 @@ $markup_types = array ('escape', 'wikicreolebracketlink', 'bracketlink', 'url', 'interwiki', 'semanticlink', 'wikiword', 'linebreak', - 'wikicreole_italics', + 'wikicreole_italics', 'wikicreole_bold', 'wikicreole_monospace', 'wikicreole_superscript', 'wikicreole_subscript', 'old_emphasis', 'nestled_emphasis', 'html_emphasis', 'html_abbr', 'plugin', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-02 20:38:05
|
Revision: 6369 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6369&view=rev Author: vargenau Date: 2009-01-02 20:38:01 +0000 (Fri, 02 Jan 2009) Log Message: ----------- Allow lang attribute for <abbr> and <acronym> Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-02 12:31:22 UTC (rev 6368) +++ trunk/lib/InlineParser.php 2009-01-02 20:38:01 UTC (rev 6369) @@ -794,7 +794,8 @@ { //rurban: abbr|acronym need an optional title tag. //sf.net bug #728595 - var $_start_regexp = "<(?: abbr|acronym )(?: \stitle=[^>]*)?>"; + // allowed attributes: title and lang + var $_start_regexp = "<(?: abbr|acronym )(?: [^>]*)?>"; function getEndRegexp ($match) { if (substr($match,1,4) == 'abbr') @@ -809,12 +810,16 @@ $tag = 'abbr'; else $tag = 'acronym'; - $rest = substr($match,1+strlen($tag),-1); - if (!empty($rest)) { - list($key,$val) = explode("=",$rest); - $args = array($key => $val); - } else $args = array(); - return new HtmlElement($tag, $args, $body); + $rest = substr($match,1+strlen($tag),-1); + $attrs = parse_attributes($rest); + // Remove attributes other than title and lang + $allowedargs = array(); + foreach ($attrs as $key => $value) { + if (in_array ($key, array("title", "lang"))) { + $allowedargs[$key] = $value; + } + } + return new HtmlElement($tag, $allowedargs, $body); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-08 09:56:59
|
Revision: 6381 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6381&view=rev Author: vargenau Date: 2009-01-08 09:56:52 +0000 (Thu, 08 Jan 2009) Log Message: ----------- Use is_image Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-08 09:47:02 UTC (rev 6380) +++ trunk/lib/InlineParser.php 2009-01-08 09:56:52 UTC (rev 6381) @@ -937,10 +937,7 @@ } // It's not a Mediawiki template, it's a Wikicreole image - if ((string_ends_with($imagename, ".jpg")) - or (string_ends_with($imagename, ".jpeg")) - or (string_ends_with($imagename, ".gif")) - or (string_ends_with($imagename, ".png"))) { + if (is_image($imagename)) { return LinkImage(UPLOAD_DATA_PATH . $imagename, $alt); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <var...@us...> - 2009-01-23 13:47:13
|
Revision: 6433 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6433&view=rev Author: vargenau Date: 2009-01-23 13:47:05 +0000 (Fri, 23 Jan 2009) Log Message: ----------- Use tt instead of pre for inline nowiki Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-23 13:22:51 UTC (rev 6432) +++ trunk/lib/InlineParser.php 2009-01-23 13:47:05 UTC (rev 6433) @@ -919,7 +919,7 @@ function markup ($match) { // Remove {{{ and }}} - return new HtmlElement('pre', substr($match, 3, -3)); + return new HtmlElement('tt', substr($match, 3, -3)); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-25 22:26:16
|
Revision: 6454 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6454&view=rev Author: vargenau Date: 2009-01-25 22:26:10 +0000 (Sun, 25 Jan 2009) Log Message: ----------- Use parse_attributes in divspan Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-25 15:19:16 UTC (rev 6453) +++ trunk/lib/InlineParser.php 2009-01-25 22:26:10 UTC (rev 6454) @@ -782,9 +782,10 @@ $tag = 'div'; $rest = substr($match,1+strlen($tag),-1); if (!empty($rest)) { - list($key,$val) = explode("=",$rest); - $args = array($key => $val); - } else $args = array(); + $args = parse_attributes($rest); + } else { + $args = array(); + } return new HtmlElement($tag, $args, $body); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-26 19:01:08
|
Revision: 6455 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6455&view=rev Author: vargenau Date: 2009-01-26 19:00:59 +0000 (Mon, 26 Jan 2009) Log Message: ----------- HTML comment Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-25 22:26:10 UTC (rev 6454) +++ trunk/lib/InlineParser.php 2009-01-26 19:00:59 UTC (rev 6455) @@ -849,6 +849,17 @@ } } +// Single-line HTML comment +// <!-- This is a comment --> +class Markup_html_comment extends SimpleMarkup +{ + var $_match_regexp = '<!--.*?-->'; + + function markup ($match) { + return HTML::raw(''); + } +} + // Special version for single-line plugins formatting, // like: '<small>< ?plugin PopularNearby ? ></small>' class Markup_plugin extends SimpleMarkup @@ -1036,6 +1047,7 @@ $non_default = false; $markup_types = array ('escape', 'wikicreolebracketlink', 'bracketlink', 'url', + 'html_comment', 'interwiki', 'semanticlink', 'wikiword', 'linebreak', 'wikicreole_italics', 'wikicreole_bold', 'wikicreole_monospace', 'wikicreole_superscript', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-27 14:45:17
|
Revision: 6457 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6457&view=rev Author: vargenau Date: 2009-01-27 14:45:01 +0000 (Tue, 27 Jan 2009) Log Message: ----------- Mediawiki compatibility: allow "Image:" and "File:" as synonyms of "Upload:" Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-27 14:25:00 UTC (rev 6456) +++ trunk/lib/InlineParser.php 2009-01-27 14:45:01 UTC (rev 6457) @@ -354,6 +354,15 @@ $rawlink = $temp; } + // Mediawiki compatibility: allow "Image:" and "File:" + // as synonyms of "Upload:" + if (string_starts_with($rawlink, "Image:")) { + $rawlink = str_replace("Image:", "Upload:", $rawlink); + } + if (string_starts_with($rawlink, "File:")) { + $rawlink = str_replace("File:", "Upload:", $rawlink); + } + $label = UnWikiEscape($label); /* * Check if the user has typed a explicit URL. This solves the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-01-31 19:39:00
|
Revision: 6476 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6476&view=rev Author: vargenau Date: 2009-01-31 19:38:55 +0000 (Sat, 31 Jan 2009) Log Message: ----------- Put superscript and subscript first Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-31 19:35:23 UTC (rev 6475) +++ trunk/lib/InlineParser.php 2009-01-31 19:38:55 UTC (rev 6476) @@ -1058,9 +1058,11 @@ ('escape', 'wikicreolebracketlink', 'bracketlink', 'url', 'html_comment', 'interwiki', 'semanticlink', 'wikiword', 'linebreak', + 'wikicreole_superscript', + 'wikicreole_subscript', 'wikicreole_italics', 'wikicreole_bold', - 'wikicreole_monospace', 'wikicreole_superscript', - 'wikicreole_subscript', 'old_emphasis', 'nestled_emphasis', + 'wikicreole_monospace', + 'old_emphasis', 'nestled_emphasis', '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. |
From: <var...@us...> - 2009-04-19 18:32:28
|
Revision: 6797 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6797&view=rev Author: vargenau Date: 2009-04-19 18:32:17 +0000 (Sun, 19 Apr 2009) Log Message: ----------- Allow absolute path for image Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-04-19 18:26:36 UTC (rev 6796) +++ trunk/lib/InlineParser.php 2009-04-19 18:32:17 UTC (rev 6797) @@ -27,8 +27,6 @@ * @package Markup * @author Geoffrey T. Dairiki, Reini Urban */ -/** - */ /** * This is the character used in wiki markup to escape characters with @@ -980,7 +978,12 @@ // It's not a Mediawiki template, it's a Wikicreole image if (is_image($imagename)) { - return LinkImage(UPLOAD_DATA_PATH . $imagename, $alt); + if ($imagename[0] == '/') { + // We should not hardcode "/phpwiki" + return LinkImage(SERVER_URL . "/phpwiki" . $imagename, $alt); + } else { + return LinkImage(UPLOAD_DATA_PATH . $imagename, $alt); + } } $page = str_replace("\n", "", $page); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-05-27 16:10:17
|
Revision: 6814 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6814&view=rev Author: vargenau Date: 2009-05-27 16:10:12 +0000 (Wed, 27 May 2009) Log Message: ----------- Handle "[[SandBox|{{image.jpg}}]]" and "[[SandBox|{{image.jpg|alt text}}]]" Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-05-25 13:18:10 UTC (rev 6813) +++ trunk/lib/InlineParser.php 2009-05-27 16:10:12 UTC (rev 6814) @@ -393,6 +393,19 @@ } else if (preg_match('/^(\.\.\/|\/)/', $link)) { return new Cached_ExternalLink($link, $label); } + + // Handle "[[SandBox|{{image.jpg}}]]" and "[[SandBox|{{image.jpg|alt text}}]]" + if (string_starts_with($label, "{{")) { + $imgurl = substr($label, 2, -2); // Remove "{{" and "}}" + $pipe = strpos($imgurl, '|'); + if ($pipe === false) { + $label = LinkImage(UPLOAD_DATA_PATH . $imgurl, $link); + } else { + list($img, $alt) = explode("|", $imgurl); + $label = LinkImage(UPLOAD_DATA_PATH . $img, $alt); + } + } else + // [label|link] // If label looks like a url to an image or object, we want an image link. if (isImageLink($label)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <var...@us...> - 2009-06-07 06:56:39
|
Revision: 6905 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6905&view=rev Author: vargenau Date: 2009-06-07 06:55:53 +0000 (Sun, 07 Jun 2009) Log Message: ----------- Revert 6865 Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-06-06 16:07:23 UTC (rev 6904) +++ trunk/lib/InlineParser.php 2009-06-07 06:55:53 UTC (rev 6905) @@ -504,7 +504,6 @@ class Markup_bracketlink extends SimpleMarkup { var $_match_regexp = "\\#? \\[ .*? [^]\\s] .*? \\]"; - // TODO: include second ] in regexp function markup ($match) { $link = LinkBracketLink($match); @@ -817,7 +816,7 @@ //rurban: abbr|acronym need an optional title tag. //sf.net bug #728595 // allowed attributes: title and lang - var $_start_regexp = "<(?: abbr|acronym )(?: \s(?: title|lang)=[^>]*)?>"; + var $_start_regexp = "<(?: abbr|acronym )(?: [^>]*)?>"; function getEndRegexp ($match) { if (substr($match,1,4) == 'abbr') @@ -993,7 +992,8 @@ // It's not a Mediawiki template, it's a Wikicreole image if (is_image($imagename)) { if ($imagename[0] == '/') { - return LinkImage(DATA_PATH . '/' . $imagename, $alt); + // We should not hardcode "/phpwiki" + return LinkImage(SERVER_URL . "/phpwiki" . $imagename, $alt); } else { return LinkImage(getUploadDataPath() . $imagename, $alt); } @@ -1023,33 +1023,6 @@ } } -/** 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?) @@ -1144,13 +1117,10 @@ $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. |
From: <var...@us...> - 2009-06-23 17:56:05
|
Revision: 6953 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6953&view=rev Author: vargenau Date: 2009-06-23 17:55:57 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Add "title, lang, id, alt" to isImageLink Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-06-23 17:54:20 UTC (rev 6952) +++ trunk/lib/InlineParser.php 2009-06-23 17:55:57 UTC (rev 6953) @@ -314,12 +314,13 @@ * size=<precent>%, size=<width>x<height> * border=n, align=\w+, hspace=n, vspace=n * width=n, height=n + * title, lang, id, alt */ function isImageLink($link) { if (!$link) return false; assert(defined('INLINE_IMAGES')); return preg_match("/\\.(" . INLINE_IMAGES . ")$/i", $link) - or preg_match("/\\.(" . INLINE_IMAGES . ")\s+(size|border|align|hspace|vspace|type|data|width|height)=/i", $link); + or preg_match("/\\.(" . INLINE_IMAGES . ")\s+(size|border|align|hspace|vspace|type|data|width|height|title|lang|id|alt)=/i", $link); } function LinkBracketLink($bracketlink) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-25 08:47:07
|
Revision: 6956 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6956&view=rev Author: vargenau Date: 2009-06-25 08:46:58 +0000 (Thu, 25 Jun 2009) Log Message: ----------- Display error at point of error instead of logging it. Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-06-24 08:04:35 UTC (rev 6955) +++ trunk/lib/InlineParser.php 2009-06-25 08:46:58 UTC (rev 6956) @@ -864,9 +864,9 @@ and (strspn(substr($color,1),'0123456789ABCDEF') == strlen($color)-1)) { return new HtmlElement('font', array('color' => $color), $body); } else { - trigger_error(sprintf(_("unknown color %s ignored"), substr($match, 7, -1)), E_USER_WARNING); + return new HtmlElement('span', array('class' => 'error'), + sprintf(_("unknown color %s ignored"), substr($match, 7, -1))); } - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-25 09:15:12
|
Revision: 6957 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6957&view=rev Author: vargenau Date: 2009-06-25 09:15:10 +0000 (Thu, 25 Jun 2009) Log Message: ----------- Use CCS instead of font tag Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-06-25 08:46:58 UTC (rev 6956) +++ trunk/lib/InlineParser.php 2009-06-25 09:15:10 UTC (rev 6957) @@ -855,14 +855,14 @@ var $_end_regexp = "%%"; function markup ($match, $body) { - $color = strtoupper(substr($match, 7, -1)); + $color = strtolower(substr($match, 7, -1)); if (strlen($color) != 7 - and in_array($color, array('RED', 'BLUE', 'GRAY', 'YELLOW', 'GREEN', 'CYAN', 'BLACK'))) + and in_array($color, array('red', 'blue', 'gray', 'yellow', 'green', 'cyan', 'black'))) { // must be a valid color name - return new HtmlElement('font', array('color' => $color), $body); + return new HtmlElement('span', array('style' => "color: $color"), $body); } elseif ((substr($color,0,1) == '#') - and (strspn(substr($color,1),'0123456789ABCDEF') == strlen($color)-1)) { - return new HtmlElement('font', array('color' => $color), $body); + and (strspn(substr($color,1),'0123456789abcdef') == strlen($color)-1)) { + return new HtmlElement('span', array('style' => "color: $color"), $body); } else { return new HtmlElement('span', array('class' => 'error'), sprintf(_("unknown color %s ignored"), substr($match, 7, -1))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-06-25 12:58:09
|
Revision: 6960 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6960&view=rev Author: vargenau Date: 2009-06-25 12:47:08 +0000 (Thu, 25 Jun 2009) Log Message: ----------- Check length of hex color Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-06-25 11:56:16 UTC (rev 6959) +++ trunk/lib/InlineParser.php 2009-06-25 12:47:08 UTC (rev 6960) @@ -856,13 +856,12 @@ function markup ($match, $body) { $color = strtolower(substr($match, 7, -1)); - if (strlen($color) != 7 - and in_array($color, array('red', 'blue', 'gray', 'yellow', 'green', 'cyan', 'black'))) - { // must be a valid color name + + if (in_array($color, array('red', 'blue', 'gray', 'yellow', 'green', 'cyan', 'black')) + or ((substr($color,0,1) == '#') + and ((strlen($color) == 4) or (strlen($color) == 7)) + and (strspn(substr($color,1),'0123456789abcdef') == strlen($color)-1))) { return new HtmlElement('span', array('style' => "color: $color"), $body); - } elseif ((substr($color,0,1) == '#') - and (strspn(substr($color,1),'0123456789abcdef') == strlen($color)-1)) { - return new HtmlElement('span', array('style' => "color: $color"), $body); } else { return new HtmlElement('span', array('class' => 'error'), sprintf(_("unknown color %s ignored"), substr($match, 7, -1))); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-07-07 20:05:03
|
Revision: 7006 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7006&view=rev Author: vargenau Date: 2009-07-07 20:04:52 +0000 (Tue, 07 Jul 2009) Log Message: ----------- Implement Mediawiki <nowiki> Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-07-07 12:20:11 UTC (rev 7005) +++ trunk/lib/InlineParser.php 2009-07-07 20:04:52 UTC (rev 7006) @@ -976,6 +976,20 @@ } /** + * Mediawiki <nowiki> + * <nowiki>...</nowiki> + */ +class Markup_nowiki extends SimpleMarkup +{ + var $_match_regexp = '<nowiki>.*?<\/nowiki>'; + + function markup ($match) { + // Remove <nowiki> and </nowiki> + return HTML::raw(substr($match, 8, -9)); + } +} + +/** * Wikicreole preformatted * {{{ * }}} @@ -1137,6 +1151,7 @@ $class = "Markup_$mtype"; $this->_addMarkup(new $class); } + $this->_addMarkup(new Markup_nowiki); if (ENABLE_MARKUP_DIVSPAN and !$non_default) $this->_addMarkup(new Markup_html_divspan); if (ENABLE_MARKUP_COLOR and !$non_default) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-08-06 08:48:39
|
Revision: 7061 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7061&view=rev Author: vargenau Date: 2009-08-06 08:48:31 +0000 (Thu, 06 Aug 2009) Log Message: ----------- Allow "#[[" syntax for anchors Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-08-05 20:05:32 UTC (rev 7060) +++ trunk/lib/InlineParser.php 2009-08-06 08:48:31 UTC (rev 7061) @@ -330,7 +330,7 @@ $wikicreolesyntax = false; - if (string_starts_with($bracketlink, "[[")) { + if (string_starts_with($bracketlink, "[[") or string_starts_with($bracketlink, "#[[")) { $wikicreolesyntax = true; $bracketlink = str_replace("[[", "[", $bracketlink); $bracketlink = str_replace("]]", "]", $bracketlink); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-08-07 05:02:38
|
Revision: 7064 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7064&view=rev Author: vargenau Date: 2009-08-07 05:02:25 +0000 (Fri, 07 Aug 2009) Log Message: ----------- Make predefined icons work in both Gforge and plain Phpwiki Modified Paths: -------------- trunk/lib/InlineParser.php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-08-06 15:18:47 UTC (rev 7063) +++ trunk/lib/InlineParser.php 2009-08-07 05:02:25 UTC (rev 7064) @@ -1045,7 +1045,11 @@ ); foreach ($predefinedicons as $ascii => $icon) { if (trim($page) == $ascii) { - return LinkImage("/wiki/themes/default/images/$icon", $page); + if (defined('GFORGE') and GFORGE) { + return LinkImage("/wiki/themes/default/images/$icon", $page); + } else { + return LinkImage(SERVER_URL . "/phpwiki/themes/default/images/$icon", $page); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |