/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: convert_html.php,v 1.11 2003/02/03 12:46:56 panda Exp $
+// $Id: convert_html.php,v 1.12 2003/02/04 01:15:40 panda Exp $
//
function &convert_html(&$lines)
function Pre($text)
{
parent::Block();
- $tab = 8;
- while (preg_match('/^([^\t]*)(\t+)(.+)$/',$text,$m)) {
- $text = $m[1].str_repeat(' ',strlen($m[2]) * $tab - strlen($m[1]) % $tab).$m[3];
- }
$this->elements[] = htmlspecialchars($text,ENT_NOQUOTES);
}
function canContain(&$obj)
}
function toString()
{
- if (preg_match("/^\#([^\(]+)(.*)$/",$this->text,$out) and exist_plugin_convert($out[1])) {
+ if (preg_match("/^\#([^\(]+)(.*)/",$this->text,$out) and exist_plugin_convert($out[1])) {
if ($out[2]) {
- $_plugin = preg_replace("/^\#([^\(]+)\((.*)\)$/ex","do_plugin_convert('$1','$2')",$this->text);
+ $_plugin = preg_replace("/^\#([^\(]+)\((.*)\)/ex","do_plugin_convert('$1','$2')",$this->text);
}
else {
- $_plugin = preg_replace("/^\#([^\(]+)$/ex","do_plugin_convert('$1','$2')",$this->text);
+ $_plugin = preg_replace("/^\#([^\(]+)/ex","do_plugin_convert('$1','$2')",$this->text);
}
$text = "\t$_plugin";
}
$last =& $this;
foreach ($lines as $line) {
+
if (substr($line,0,2) == '//') { //¥³¥á¥ó¥È¤Ï½èÍý¤·¤Ê¤¤
continue;
}
- $line = rtrim($line);
-
$align = '';
if (preg_match('/^(LEFT|CENTER|RIGHT):(.*)$/',$line,$matches)) {
$last =& $last->add(new Align(strtolower($matches[1]))); // <div style="text-align:...">
$line = $matches[2];
}
+ $line = preg_replace("/[\r\n]*$/",'',$line);
+
// ¹ÔƬʸ»ú
$head = substr($line,0,1);
}
else {
if (substr($line,-1) == '~') {
- $line .= "\r";
+ $line = substr($line,0,-1)."\r";
}
if ($head == '-') { // UList
$last =& $last->add(new UList($line)); // inline
// ´ØÏ¢¤¹¤ë¥Ú¡¼¥¸
// <p>¤Î¤È¤¤Ï¹ÔƬ¤«¤é¡¢<del>¤Î¤È¤¤Ï¾¤ÎÍ×ÁǤλÒÍ×ÁǤȤ·¤Æ¸ºß
$text = preg_replace('/<(p|del)>#related<\/\1>/e','make_related($vars[\'page\'],\'$1\')',$text);
-
return $text;
}
}
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: pukiwiki.ini.php,v 1.20 2003/02/03 12:46:56 panda Exp $
+// $Id: pukiwiki.ini.php,v 1.21 2003/02/04 01:15:40 panda Exp $
//
// PukiWiki setting file
"'''(?!')((?:(?!''').)*)'''" => '<em>$1</em>',
"''(?!')((?:(?!'').)*)''" => '<strong>$1</strong>',
'&(#[0-9]+|#x[0-9a-f]+|[0-9a-zA-Z]+);' => '&$1;',
-"~\r" => '<br />', /* ¹ÔËö¤Ë¥Á¥ë¥À¤Ï²þ¹Ô */
+"\r" => "<br />\n", /* ¹ÔËö¤Ë¥Á¥ë¥À¤Ï²þ¹Ô */
'#related' => '<del>#related</del>',
);