Closed KoljaL closed 3 years ago
maybe a little dirty, but it seems to work:
ParsedownExtended.php:630
// var for code case
$is_code = false;
foreach ($lines as $headerLine) {
// if code detected (line starts with "``") toggle code var
if (strspn($headerLine, '``') > 0)
{
$is_code = !$is_code;
}
// only search for headers, if code var is false
if (($is_code == false) && ((strspn($headerLine, '#') > 0) || (strspn($headerLine, '=') >= 3) || (strspn($headerLine, '-') >= 3))){
Hello @KoljaL i have rewritten the ToC function from top to bottom and just like to hear what features you would like me to include in the ToC
Thanks for the question, but when you've fixed the code block problem, I'll be happy. The only thing I can think of as a new (and perhaps useful) function is a "highlighting the current position on page in the TOC", with a bold font, or something. But JavaScript is necessary for this and that takes away the elegance of the whole thing.
I may have found an issue, because if the markdown page contains code blocks that uses hash characters for commenting out, all these lines will be displayed as headings in the ToC.
Example.md:
makes this HTML Code: