|
From: <var...@us...> - 2009-01-13 18:18:42
|
Revision: 6399
http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6399&view=rev
Author: vargenau
Date: 2009-01-13 18:18:36 +0000 (Tue, 13 Jan 2009)
Log Message:
-----------
<noinclude> and </noinclude> should not appear even when not included
Modified Paths:
--------------
trunk/lib/BlockParser.php
trunk/lib/HtmlParser.php
trunk/pgsrc/ReleaseNotes
Modified: trunk/lib/BlockParser.php
===================================================================
--- trunk/lib/BlockParser.php 2009-01-12 20:23:09 UTC (rev 6398)
+++ trunk/lib/BlockParser.php 2009-01-13 18:18:36 UTC (rev 6399)
@@ -919,7 +919,7 @@
class Block_pre extends BlockMarkup
{
- var $_re = '<(?:pre|verbatim|nowiki)>';
+ var $_re = '<(?:pre|verbatim|nowiki|noinclude)>';
function _match (&$input, $m) {
$endtag = '</' . substr($m->match, 1);
@@ -943,9 +943,13 @@
// FIXME: no <img>, <big>, <small>, <sup>, or <sub>'s allowed
// in a <pre>.
- if ($m->match == '<pre>')
+ if ($m->match == '<pre>') {
$text = TransformInline($text);
- if ($m->match == '<nowiki>') {
+ }
+ if ($m->match == '<noinclude>') {
+ $text = TransformText($text);
+ $this->_element = new Block_HtmlElement('div', false, $text);
+ } else if ($m->match == '<nowiki>') {
$text = TransformInlineNowiki($text);
$this->_element = new Block_HtmlElement('p', false, $text);
} else {
Modified: trunk/lib/HtmlParser.php
===================================================================
--- trunk/lib/HtmlParser.php 2009-01-12 20:23:09 UTC (rev 6398)
+++ trunk/lib/HtmlParser.php 2009-01-13 18:18:36 UTC (rev 6399)
@@ -267,6 +267,7 @@
'sub' => "wikify_default",
'nowiki' => "wikify_verbatim",
'verbatim' => "wikify_default",
+ 'noinclude' => "wikify_noinclude",
);
}
@@ -328,6 +329,10 @@
return "\n<verbatim>\n$contents\n</verbatim>";
}
+ function wikify_noinclude( $node ) {
+ return $this->elem_contents( $node );
+ }
+
function wikify_img( $node ) {
$image_url = $this->absolute_url( $node->getAttr('src') );
$file = basename( $image_url );
@@ -429,4 +434,4 @@
// c-hanging-comment-ender-p: nil
// indent-tabs-mode: nil
// End:
-?>
\ No newline at end of file
+?>
Modified: trunk/pgsrc/ReleaseNotes
===================================================================
--- trunk/pgsrc/ReleaseNotes 2009-01-12 20:23:09 UTC (rev 6398)
+++ trunk/pgsrc/ReleaseNotes 2009-01-13 18:18:36 UTC (rev 6399)
@@ -67,6 +67,7 @@
* UserPreferences: specific message when only one preference is updated (vargenau)
* renamed class Theme to ~WikiTheme to avoid Gforge name clash (vargenau)
* numeric cells in tables are now right-aligned by default
+* <noinclude> and </noinclude> should not appear even when not included
!! New
* ~PageList supports listtype=ul,ol,dl. dl used by FullTextSearch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|