We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1329def commit 8ca49efCopy full SHA for 8ca49ef
scripts/docs/html2mdx.py
@@ -89,7 +89,13 @@ def _html2md(content):
89
def _fix_markdown(content):
90
no_templates = _TEMPLATE_RE.sub("", content)
91
no_html_links = _HTML_LINK_RE.sub(_fix_link, no_templates)
92
- return _HEADING_RE.sub("---\ntitle: '\\1'\n---", no_html_links)
+ fixed_headings = _HEADING_RE.sub("---\ntitle: '\\1'\n---", no_html_links)
93
+ return _remove_trailing_whitespaces(fixed_headings)
94
+
95
96
+def _remove_trailing_whitespaces(content):
97
+ lines = (l.rstrip() for l in content.split("\n"))
98
+ return "\n".join(lines)
99
100
101
def _fix_link(m):
0 commit comments