ヘッダーIDの追加

諏訪子 <suwako@076.moe>、2026-02-27 02:11
コミット 0bf04e7301944c04e64e611632b1739207c203ff ・親 22a7ca6 ・ファイルを見る

1個のファイル、+3 -1

@@ -80,6 +80,7 @@
8080 $tableRows = [];
8181 $inTable = false;
8282 $i = 0;
83+ $headerCount = 1;
8384
8485 foreach ($lines as $line) {
8586 $i++;
@@ -196,7 +197,8 @@
196197 }
197198
198199 $level = strlen($m[1]);
199- $this->html[] = " <h{$level}>".$this->parseInline($m[2])."</h{$level}>";
200+ $this->html[] = " <h{$level} id=\"section-{$headerCount}\">".$this->parseInline($m[2])."</h{$level}>";
201+ $headerCount++;
200202 continue;
201203 }
202204