1
0
mirror of https://github.com/makeworld-the-better-one/md2gemini synced 2025-04-09 22:39:04 +02:00

🐛 Don't fail on empty input

Reported by Dmitry Bogatov by email.
This commit is contained in:
makeworld 2020-11-02 09:17:06 -05:00
parent 6b925187b7
commit 10f126146f
2 changed files with 9 additions and 0 deletions

@ -72,6 +72,9 @@ def md2gemini(
table_tag: "The default alt text for table blocks."
"""
if len(markdown) == 0:
return ""
# Pre processing
# Remove frontmatter
frontmatterExists = False

@ -6,6 +6,12 @@ def f(md):
return normalize(md2gemini(md, plain=True))
def test_empty_input():
md = ""
gem = ""
assert f(md) == gem
def test_remove_bold():
md = "Sentence with **bold** in it."
gem = "Sentence with bold in it."