mirror of
https://github.com/typemill/typemill.git
synced 2025-07-31 19:30:40 +02:00
Version 1.5.1.1: Fix ToC-Error with headline anchors
This commit is contained in:
@@ -363,6 +363,8 @@ class ParsedownExtension extends \ParsedownExtra
|
||||
|
||||
$text = trim($text, ' ');
|
||||
|
||||
$tocText = $text;
|
||||
|
||||
if($this->showAnchor && $level > 1)
|
||||
{
|
||||
$text = "[#](#h-$headline){.tm-heading-anchor}" . $text;
|
||||
@@ -382,7 +384,7 @@ class ParsedownExtension extends \ParsedownExtra
|
||||
)
|
||||
);
|
||||
|
||||
$this->headlines[] = array('level' => $level, 'name' => $Block['element']['name'], 'attribute' => $Block['element']['attributes']['id'], 'text' => $text);
|
||||
$this->headlines[] = array('level' => $level, 'name' => $Block['element']['name'], 'attribute' => $Block['element']['attributes']['id'], 'text' => $tocText);
|
||||
|
||||
return $Block;
|
||||
}
|
||||
|
Reference in New Issue
Block a user