blob: f5f821e95c904c6559c1f8b81b65001a2e44eb9a [file] [log] [blame]
from markdown_it import MarkdownIt
from markdown_it import presets
def test_highlight_arguments():
def highlight_func(str_, lang, attrs):
assert lang == "a"
assert attrs == "b c d"
return "<pre><code>==" + str_ + "==</code></pre>"
conf = presets.commonmark.make()
conf["options"]["highlight"] = highlight_func
md = MarkdownIt(config=conf)
assert md.render("``` a b c d \nhl\n```") == "<pre><code>==hl\n==</code></pre>\n"