feat(md2doc): copy _bulletize helper from md2pdf (spec §3.3)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
"""Tests for _bulletize — verifies behavior copied from md2pdf.py."""
|
||||
from md2doc import _bulletize
|
||||
|
||||
|
||||
def test_simple_dash_list_becomes_bullets():
|
||||
text = "- item A\n- item B\n"
|
||||
result = _bulletize(text)
|
||||
assert "• item A" in result
|
||||
assert "• item B" in result
|
||||
|
||||
|
||||
def test_code_block_dashes_preserved():
|
||||
"""Dashes inside ``` blocks must NOT be bulletized."""
|
||||
text = "```bash\n-r flag\n--verbose\n```\n"
|
||||
result = _bulletize(text)
|
||||
assert "-r flag" in result
|
||||
assert "--verbose" in result
|
||||
|
||||
|
||||
def test_html_block_dashes_preserved():
|
||||
"""Dashes inside raw HTML blocks (table/div/etc.) must NOT be bulletized."""
|
||||
text = "<table>\n- not a list\n</table>\n"
|
||||
result = _bulletize(text)
|
||||
assert "- not a list" in result
|
||||
|
||||
|
||||
def test_tilde_fence_also_preserved():
|
||||
text = "~~~bash\n-x\n~~~\n"
|
||||
result = _bulletize(text)
|
||||
assert "-x" in result
|
||||
Reference in New Issue
Block a user