毎度どうも。訳あって*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 |
1 | 2 |