parser: add id to automatic table of contents heading

This commit is contained in:
Starbeamrainbowlabs 2020-05-23 23:00:46 +01:00
parent d99587079f
commit 6c11ef4957
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 1 additions and 1 deletions

View File

@ -1319,7 +1319,7 @@ class PeppermintParsedown extends ParsedownExtra
if($settings->parser_toc_heading_level > 1)
array_unshift(
$elements,
[ "name" => "h$settings->parser_toc_heading_level", "text" => "Table of Contents" ]
[ "name" => "h$settings->parser_toc_heading_level", "text" => "Table of Contents", "attributes" => [ "id" => "table-of-contents" ] ]
);
return trim($this->elements($elements), "\n");