diff options
author | 2024-12-30 15:11:49 +0000 | |
---|---|---|
committer | 2024-12-30 15:11:49 +0000 | |
commit | 4fedcef87edaf52abbc0b7331e206bf48d645271 (patch) | |
tree | acb1e9fa15d235a9c943f2803c2a8f43ea249211 | |
parent | Remove surrounding whitespace from doc description markdown (diff) |
Fix rendering of markdown headers in docs
-rw-r--r-- | bot/exts/info/doc/_markdown.py | 2 | ||||
-rw-r--r-- | tests/bot/exts/info/doc/test_parsing.py | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/info/doc/_markdown.py b/bot/exts/info/doc/_markdown.py index f3d769070..a030903ed 100644 --- a/bot/exts/info/doc/_markdown.py +++ b/bot/exts/info/doc/_markdown.py @@ -31,7 +31,7 @@ class DocMarkdownConverter(markdownify.MarkdownConverter): bullet = bullets[depth % len(bullets)] return f"{bullet} {text}\n" - def convert_hn(self, _n: int, el: PageElement, text: str, convert_as_inline: bool) -> str: + def _convert_hn(self, _n: int, el: PageElement, text: str, convert_as_inline: bool) -> str: """Convert h tags to bold text with ** instead of adding #.""" if convert_as_inline: return text diff --git a/tests/bot/exts/info/doc/test_parsing.py b/tests/bot/exts/info/doc/test_parsing.py index 065255bea..7136fc32c 100644 --- a/tests/bot/exts/info/doc/test_parsing.py +++ b/tests/bot/exts/info/doc/test_parsing.py @@ -96,6 +96,7 @@ class MarkdownCreationTest(TestCase): test_cases = ( ("<p>Hello World</p>", "Hello World"), ("<p>Hello</p><p>World</p>", "Hello\n\nWorld"), + ("<h1>Title</h1>", "**Title**") ) self._run_tests(test_cases) |