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:
parent
1610e4747c
commit
7ead769742
@ -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',
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user