|
From: <var...@us...> - 2009-02-17 14:47:11
|
Revision: 6509
http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6509&view=rev
Author: vargenau
Date: 2009-02-17 14:47:05 +0000 (Tue, 17 Feb 2009)
Log Message:
-----------
Wikicreole placeholder
Modified Paths:
--------------
trunk/lib/BlockParser.php
trunk/lib/InlineParser.php
Modified: trunk/lib/BlockParser.php
===================================================================
--- trunk/lib/BlockParser.php 2009-02-17 11:26:21 UTC (rev 6508)
+++ trunk/lib/BlockParser.php 2009-02-17 14:47:05 UTC (rev 6509)
@@ -368,7 +368,7 @@
if (!is_object($_regexpset)) {
// nowiki_wikicreole must be before template_plugin
$Block_types = array
- ('nowiki_wikicreole', 'template_plugin', 'oldlists', 'list', 'dl', 'table_dl', 'table_wikicreole', 'table_mediawiki',
+ ('nowiki_wikicreole', 'template_plugin', 'placeholder', 'oldlists', 'list', 'dl', 'table_dl', 'table_wikicreole', 'table_mediawiki',
'blockquote', 'heading', 'heading_wikicreole', 'hr', 'pre', 'email_blockquote',
'plugin', 'plugin_wikicreole', 'p');
// insert it before p!
@@ -952,6 +952,35 @@
return true;
}
}
+
+// Wikicreole placeholder
+// <<<placeholder>>>
+class Block_placeholder extends BlockMarkup
+{
+ var $_re = '<<<';
+
+ function _match (&$input, $m) {
+ $endtag = '>>>';
+ $text = array();
+ $pos = $input->getPos();
+
+ $line = $m->postmatch;
+ while (ltrim($line) != $endtag) {
+ $text[] = $line;
+ if (($line = $input->nextLine()) === false) {
+ $input->setPos($pos);
+ return false;
+ }
+ }
+ $input->advance();
+
+ $text = join("\n", $text);
+ $text = '<<<' . $text . '>>>';
+ $this->_element = new Block_HtmlElement('div', false, $text);
+ return true;
+ }
+}
+
class Block_nowiki_wikicreole extends BlockMarkup
{
var $_re = '{{{';
Modified: trunk/lib/InlineParser.php
===================================================================
--- trunk/lib/InlineParser.php 2009-02-17 11:26:21 UTC (rev 6508)
+++ trunk/lib/InlineParser.php 2009-02-17 14:47:05 UTC (rev 6509)
@@ -858,6 +858,17 @@
}
}
+// Wikicreole placeholder
+// <<<placeholder>>>
+class Markup_placeholder extends SimpleMarkup
+{
+ var $_match_regexp = '<<<.*?>>>';
+
+ function markup ($match) {
+ return HTML::span($match);
+ }
+}
+
// Single-line HTML comment
// <!-- This is a comment -->
class Markup_html_comment extends SimpleMarkup
@@ -1056,7 +1067,7 @@
$non_default = false;
$markup_types = array
('escape', 'wikicreolebracketlink', 'bracketlink', 'url',
- 'html_comment',
+ 'html_comment', 'placeholder',
'interwiki', 'semanticlink', 'wikiword', 'linebreak',
'wikicreole_superscript',
'wikicreole_subscript',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|