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:
parent
6b925187b7
commit
10f126146f
@ -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."
|
||||
|
Loading…
Reference in New Issue
Block a user