You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
608 B
17 lines
608 B
from imwald.core.md_render import markdown_html_fragment, markdown_plain_summary |
|
|
|
|
|
def test_plain_summary_strips_markdown_noise() -> None: |
|
s = markdown_plain_summary("# Title\n\nHello **world**", max_len=80) |
|
assert "Title" in s and "world" in s |
|
assert "**" not in s and "#" not in s |
|
|
|
|
|
def test_markdown_renders_strong() -> None: |
|
html = markdown_html_fragment("Hello **world**") |
|
assert "<strong>world</strong>" in html or "<b>world</b>" in html |
|
|
|
|
|
def test_markdown_fenced_code() -> None: |
|
html = markdown_html_fragment("```\n1 + 1\n```") |
|
assert "<pre>" in html and "<code>" in html
|
|
|