行頭が半角空白で始まる行は整形済みテキストとなります。
と記載がありますが、実際には行頭がタブでも整形済テキストになります。
行頭はタブでも良いと思うので、FormattingRules#g72f3a72 を訂正した方が良いんじゃないでしょうか。
半角空白でスタートする整形済テキストはその半角空白が除去されますが、タブスタートの整形済テキストは行頭のタブが除去されません。
例1:半角空白スタート 例2:タブスタート
(半角スペースとタブを混ぜてもひと続きの整形済テキストになるの気持ち悪いですね…笑)
convert_html.php L780
// ' 'Space-beginning sentence // ' 'Space-beginning sentence // ' 'Space-beginning sentence class Pre extends Element { function Pre(& $root, $text) { $this->__construct($root, $text); } function __construct(& $root, $text) { global $preformat_ltrim; parent::__construct(); $this->elements[] = htmlsc( (! $preformat_ltrim || $text == '' || $text[0] != ' ') ? $text : substr($text, 1)); } // : // 略 // : }
タブ文字が $text[0] != ' ' に引っかかって $text がそのまま出力されています。
convert_html.php L955あたり
// The first character $head = $line[0]; // : // 略 // : // Pre if ($head == ' ' || $head == "\t") { $this->last = & $this->last->add(new Pre($this, $line)); continue; }
明確にタブ文字スタート行が整形済テキストだと扱われています。