水平線は「-を4つ以上並べ、行末まで空白以外の文字が現れない」にルール変更
--- 3段目 ---- 4段目 ----- 5段目
※↑ver 1.4.7でパッチがうまく当たらなかったので、1.4.7用のパッチを作りました。下に張り付けてあります。by TOBY
if ($params['title'] and preg_match('/^(\*{1,3})/',$line,$matches))
このほかにもいくつかのプラグインで、preg_match('/^(\*{1,3})/',~という形で参照してるので、どこまで反映させるか、個々の判断ってとこかな。-- reimy 2003-12-26 (金) 23:07:42
$this->level++; // h2,h3,h4
diff -u -r pukiwiki-1.4.7_notb/lib/convert_html.php list_unlimit_pukiwiki-1.4.7_notb/lib/convert_html.php --- pukiwiki-1.4.7_notb/lib/convert_html.php 2006-05-13 16:29:58.000000000 +0900 +++ list_unlimit_pukiwiki-1.4.7_notb/lib/convert_html.php 2008-05-19 14:30:20.062500000 +0900 @@ -238,7 +238,7 @@ { parent::Element(); - $this->level = min(3, strspn($text, '*')); + $this->level = min(5, strspn($text, '*')); list($text, $this->msg_top, $this->id) = $root->getAnchor($text, $this->level); $this->insert(Factory_Inline($text)); $this->level++; // h2,h3,h4 @@ -306,7 +306,7 @@ $this->tag = $tag; $this->tag2 = $tag2; - $this->level = min(3, strspn($text, $head)); + $this->level = strspn($text, $head); $text = ltrim(substr($text, $this->level)); parent::insert(new ListElement($this->level, $tag2)); @@ -426,7 +426,7 @@ parent::Element(); $head = substr($text, 0, 1); - $this->level = min(3, strspn($text, $head)); + $this->level = strspn($text, $head); $text = ltrim(substr($text, $this->level)); if ($head == '<') { // Blockquote close @@ -846,7 +846,7 @@ } // Horizontal Rule - if (substr($line, 0, 4) == '----') { + if (preg_match('/^-{4,}\s*$/', $line)) { $this->insert(new HRule($this, $line)); continue; } diff -u -r pukiwiki-1.4.7_notb/lib/html.php list_unlimit_pukiwiki-1.4.7_notb/lib/html.php --- pukiwiki-1.4.7_notb/lib/html.php 2006-04-16 02:33:35.000000000 +0900 +++ list_unlimit_pukiwiki-1.4.7_notb/lib/html.php 2008-05-19 14:30:20.078125000 +0900 @@ -382,11 +382,11 @@ // Cut fixed-heading anchors $id = ''; $matches = array(); - if (preg_match('/^(\*{0,3})(.*?)\[#([A-Za-z][\w-]+)\](.*?)$/m', $str, $matches)) { + if (preg_match('/^(\*{0,5})(.*?)\[#([A-Za-z][\w-]+)\](.*?)$/m', $str, $matches)) { $str = $matches[2] . $matches[4]; $id = & $matches[3]; } else { - $str = preg_replace('/^\*{0,3}/', '', $str); + $str = preg_replace('/^\*{0,5}/', '', $str); } // Cut footnotes and tags diff -u -r pukiwiki-1.4.7_notb/plugin/pcomment.inc.php list_unlimit_pukiwiki-1.4.7_notb/plugin/pcomment.inc.php --- pukiwiki-1.4.7_notb/plugin/pcomment.inc.php 2005-10-04 23:31:22.000000000 +0900 +++ list_unlimit_pukiwiki-1.4.7_notb/plugin/pcomment.inc.php 2008-05-19 14:30:20.093750000 +0900 @@ -234,14 +234,14 @@ if ($reply_hash != '') { while ($end_position < $count) { $matches = array(); - if (preg_match('/^(\-{1,2})(?!\-)(.*)$/', $postdata[$end_position++], $matches) + if (preg_match('/^(\-+)(.*)$/', $postdata[$end_position++], $matches) && md5($matches[2]) == $reply_hash) { $b_reply = TRUE; $level = strlen($matches[1]) + 1; while ($end_position < $count) { - if (preg_match('/^(\-{1,3})(?!\-)/', $postdata[$end_position], $matches) + if (preg_match('/^(\-+)/', $postdata[$end_position], $matches) && strlen($matches[1]) < $level) break; ++$end_position; } @@ -341,7 +341,7 @@ foreach ($data as $line) { if ($count > 0 && $dir && $cnt == $count) break; - if (preg_match('/^(\-{1,2})(?!\-)(.+)$/', $line, $matches)) { + if (preg_match('/^(\-+)(.+)$/', $line, $matches)) { if ($count > 0 && strlen($matches[1]) == 1 && ++$cnt > $count) break; // Ready for radio-buttons