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