From 98366a17de8fe1acb7a6a0034f2ee9d9475d1dc0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 6 Dec 2022 14:43:03 +0000 Subject: [PATCH] html bookmark --- markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown.py b/markdown.py index 9f9e1c787..355e79025 100644 --- a/markdown.py +++ b/markdown.py @@ -385,7 +385,7 @@ def markdown_to_html(markdown: str) -> str: for hsh, hashes in titles.items(): if line.startswith(hashes): - bookmark_str = line.lower().replace(' ', '-') + bookmark_str = line.split(' ', 1)[1].lower().replace(' ', '-') line = line.replace(hashes, '').strip() line = '<' + hsh + ' id="' + bookmark_str + '">' + \ line + '\n'