From c65a84ae3f4059c69acab26c39c9933f21f31654 Mon Sep 17 00:00:00 2001 From: arino Date: Tue, 10 Jun 2003 22:57:49 +0900 Subject: [PATCH] =?utf8?q?Contents=5FUList=E3=82=AF=E3=83=A9=E3=82=B9?= =?utf8?q?=E3=81=AE=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF?= =?utf8?q?=E3=82=BF=E3=81=AE=E5=BC=95=E6=95=B0=E3=81=8C=E9=96=93=E9=81=95?= =?utf8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- convert_html.php | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/convert_html.php b/convert_html.php index 659dfb0..3cd26b7 100644 --- a/convert_html.php +++ b/convert_html.php @@ -2,7 +2,7 @@ ///////////////////////////////////////////////// // PukiWiki - Yet another WikiWikiWeb clone. // -// $Id: convert_html.php,v 1.43 2003/06/04 02:04:16 arino Exp $ +// $Id: convert_html.php,v 1.44 2003/06/10 13:57:49 arino Exp $ // function convert_html($lines) { @@ -724,8 +724,13 @@ class Body extends Block { $this->last =& $this; - foreach ($lines as $line) + while (count($lines)) { + // Experimental: ¹ÔƬ
¤«¤é¹ÔƬ
¤Þ¤Ç¤òÀ°·ÁºÑ¤ß¤È¤ß¤Ê¤¹ +// $this->block($lines,'
','
','Pre'); + + $line = array_shift($lines); + if (substr($line,0,2) == '//') //¥³¥á¥ó¥È¤Ï½èÍý¤·¤Ê¤¤ { continue; @@ -798,7 +803,7 @@ class Body extends Block '' : " &aname($id,super,full)\{$_symbol_anchor};"; $id = "content_{$this->id}_{$this->count}"; $this->count++; - $this->contents_last =& $this->contents_last->add(new Contents_UList($text,$this->id,$level,$id)); + $this->contents_last =& $this->contents_last->add(new Contents_UList($text,$level,$id)); return array($text.$anchor,$this->count > 1 ? $top : '',$id); } function getContents() @@ -828,10 +833,27 @@ class Body extends Block $text = preg_replace('/<(p|del)>#related<\/\1>/e','make_related($vars[\'page\'],\'$1\')',$text); return $text; } + function block(&$lines,$start,$end,$class) + { + if (rtrim($lines[0]) != $start) + { + return; + } + array_shift($lines); + while (count($lines)) + { + $line = array_shift($lines); + if (rtrim($line) == $end) + { + return; + } + $this->last = &$this->last->add(new $class($this,$line)); + } + } } class Contents_UList extends ListContainer { - function Contents_UList($text,$id,$level,$id) + function Contents_UList($text,$level,$id) { // ¥Æ¥­¥¹¥È¤Î¥ê¥Õ¥©¡¼¥à // ¹ÔƬ\n¤ÇÀ°·ÁºÑ¤ß¤òɽ¤¹ ... X( -- 2.11.0