1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Create ID's for Header elements so they can be referenced in anchor tags

Closes #710
This commit is contained in:
netniV 2020-04-29 16:54:49 +00:00
parent 1610e4747c
commit 7ead769742

View File

@ -553,15 +553,19 @@ class Parsedown
}
$text = trim($text, ' ');
$link = strtolower(str_replace(' ','-',$text));
$Block = array(
'element' => array(
'name' => 'h' . $level,
'attributes' => array(
'id' => $link,
),
'handler' => array(
'function' => 'lineElements',
'argument' => $text,
'destination' => 'elements',
)
),
),
);
@ -1992,3 +1996,4 @@ class Parsedown
'wbr', 'time',
);
}