セル数の違うテーブルを並べると、前のテーブルが閉じない

メッセージ

毎度どうも。訳あって*1、convert_htmlを穴があくほど眺めています。

たとえば

|1|
|1|2|

と書くと

<div class="ie5">
 <table class="style_table" cellspacing="1" border="0">
  <tr>
   <td class="style_td">1</td>
  </tr>
<!--ここに </table></div>が必要-->
<div class="ie5">
 <table class="style_table" cellspacing="1" border="0">
  <tr>
   <td class="style_td">1</td>
   <td class="style_td">2</td>
  </tr>
 </table>
</div>

となってしまいます。

問題の場所

--- html.php.orig	2002-08-07 16:53:49.000000000 +0900
+++ html.php	2002-08-07 17:42:37.000000000 +0900
@@ -106,10 +106,12 @@
 	{
 		if(!preg_match("/^\/\/(.*)/",$line,$comment_out) && $table != 0)
 		{
-			if(!preg_match("/^\|(.+)\|$/",$line,$out))
-				array_push($result, "</table></div>");
-			if(!$out[1] || $table != count(explode("|",$out[1])))
+			if(!preg_match("/^\|(.+)\|$/",$line,$out) or
+				$table != count(explode("|",$out[1])))
+			{
 				$table = 0;
+				array_push($result, "</table></div>");
+			}
 		}
 
 		$comment_out = $comment_out[1];

サンプル

1
12


*1 暇なんです XD

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2002-11-05 (火) 17:35:41
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.234 sec.

SourceForge