From 16a5b7d232e0021a704a71af68027c2052527375 Mon Sep 17 00:00:00 2001 From: dairiki Date: Fri, 1 Feb 2002 06:13:48 +0000 Subject: [PATCH] Fix bug in plugin parsing. And remove debugging output. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@1750 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/BlockParser.php | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/BlockParser.php b/lib/BlockParser.php index 819ffd5d4..9626fc406 100644 --- a/lib/BlockParser.php +++ b/lib/BlockParser.php @@ -1,4 +1,4 @@ - * * This file is part of PhpWiki. @@ -703,22 +703,24 @@ class Block_plugin extends Block_pre { var $_tag = 'div'; var $_attr = array('class' => 'plugin'); - var $_re = '<\?plugin(?:-form)?\s'; - + var $_re = '<\?plugin(?:-form)?(?!\S)'; + + // FIXME: + /* + * + * should work. */ function _match (&$input, $m) { - if (preg_match('/( .*? (? ) (.*)/x', $m->postmatch, $mm)) { - if (ltrim($mm[2])) - return false; - $pi = $m->match . $m->postmatch; - $input->advance(); - printXML(HTML::p("PI:", $pi)); - - } - else { - if (($text = $this->_getBlock($input, '?>')) === false) + $pos = $input->getPos(); + $pi = $m->match . $m->postmatch; + while (!preg_match('/(?\s*$/', $pi)) { + if (($line = $input->nextLine()) === false) { + $input->setPos($pos); return false; - $pi = $m->match . $m->postmatch . "\n" . join("\n", $text) . "\n?>"; + } + $pi .= "\n$line"; } + $input->advance(); global $request; $loader = new WikiPluginLoader; -- 2.45.0