ヘッダーIDの追加
This commit is contained in:
@@ -80,6 +80,7 @@ class Markdown {
|
||||
$tableRows = [];
|
||||
$inTable = false;
|
||||
$i = 0;
|
||||
$headerCount = 1;
|
||||
|
||||
foreach ($lines as $line) {
|
||||
$i++;
|
||||
@@ -196,7 +197,8 @@ class Markdown {
|
||||
}
|
||||
|
||||
$level = strlen($m[1]);
|
||||
$this->html[] = " <h{$level}>".$this->parseInline($m[2])."</h{$level}>";
|
||||
$this->html[] = " <h{$level} id=\"section-{$headerCount}\">".$this->parseInline($m[2])."</h{$level}>";
|
||||
$headerCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user