<?php
// PukiWiki - Yet another WikiWikiWeb clone
-// $Id: convert_html.php,v 1.12 2005/04/30 05:21:00 henoheno Exp $
+// $Id: convert_html.php,v 1.13 2005/06/30 13:20:05 henoheno Exp $
// Copyright (C)
// 2002-2005 PukiWiki Developers Team
// 2001-2002 Originally written by yu-ji
function & Factory_Div(& $root, $text)
{
- if (! preg_match('/^\#([^\(]+)(?:\((.*)\))?/', $text, $out) ||
- ! exist_plugin_convert($out[1])) {
- return new Paragraph($text);
- } else {
- return new Div($out);
+ $matches = array();
+
+ // Seems block plugin?
+ if (preg_match('/^\#([^\(]+)(?:\((.*)\))?/', $text, $matches) &&
+ exist_plugin_convert($matches[1])) {
+ return new Div($matches);
}
+
+ return new Paragraph($text);
}
// ¥¤¥ó¥é¥¤¥óÍ×ÁÇ
}
}
-// #something (started with '#')
+// Block plugin: #something (started with '#')
class Div extends Element
{
var $name;
function toString()
{
+ // Call #plugin
return do_plugin_convert($this->name, $this->param);
}
}
<?php
// PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: plugin.php,v 1.13 2005/04/30 05:21:00 henoheno Exp $
+// $Id: plugin.php,v 1.14 2005/06/30 13:20:05 henoheno Exp $
// Copyright (C)
// 2002-2005 PukiWiki Developers Team
// 2001-2002 Originally written by yu-ji
if(do_plugin_init($name) === FALSE)
return '[Plugin init failed: ' . $name . ']';
- if ($args !== '') {
- $aryargs = csv_explode(',', $args);
+ if ($args === '') {
+ $aryargs = array(); // #plugin()
} else {
- $aryargs = array();
+ $aryargs = csv_explode(',', $args); // #plugin(A,B,C,D)
}
$_digest = $digest;