カテゴリ | |
---|---|
サマリ | 「****」で<h5>を指定したい |
バージョン | 1.4.6 |
投稿者 | H.K |
状態 | 完了 |
投稿日 | 2005-12-16 (金) 13:46:18 |
デフォルトでは見出しは3つのレベルで、「*」で<h2>、「**」で<h3>、「***」で<h4> になります。 4つのレベルで表現したいため、「****」で<h5>となるようにconvert_html.phpの240行目をいじってみました。
変更前:$this->level = min(3, strspn($text, '*')); 変更後:$this->level = min(4, strspn($text, '*'));
すると見事に<h5>にはなるのですが、「*」が余分に出力されてしまいます。
(例)****あいうえお ---> <h5>*あいうえお</h5>
どうしたら「****」で4レベル目を表現できるでしょうか。 (=余分な「*」を表示させないことは可能でしょうか。)
lib/html.php : 366行目付近 $matches = array(); - if (preg_match('/^(\*{0,3})(.*?)\[#([A-Za-z][\w-]+)\](.*?)$/m', $str, $matches)) { + if (preg_match('/^(\*{0,4})(.*?)\[#([A-Za-z][\w-]+)\](.*?)$/m', $str, $matches)) { $str = $matches[2] . $matches[4];
lib/html.php : 370行目 - $str = preg_replace('/^\*{0,3}/', '', $str); + $str = preg_replace('/^\*{0,4}/', '', $str);