Skip to content

Commit 4092ce8

Browse files
committed
Remove broken hack for reflowing markdown text
1 parent 0a30daf commit 4092ce8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bot/exts/info/doc/_markdown.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
import re
21
from urllib.parse import urljoin
32

43
import markdownify
54
from bs4.element import PageElement
65

7-
# See https://github.com/matthewwithanm/python-markdownify/issues/31
8-
markdownify.whitespace_re = re.compile(r"[\r\n\s\t ]+")
9-
106

117
class DocMarkdownConverter(markdownify.MarkdownConverter):
128
"""Subclass markdownify's MarkdownCoverter to provide custom conversion methods."""
139

1410
def __init__(self, *, page_url: str, **options):
15-
super().__init__(**options)
11+
# Reflow text to avoid unwanted line breaks.
12+
default_options = {"wrap": True, "wrap_width": None}
13+
14+
super().__init__(**default_options | options)
1615
self.page_url = page_url
1716

1817
def convert_li(self, el: PageElement, text: str, parent_tags: set[str]) -> str:

0 commit comments

Comments
 (0)