feature: add dash renderer
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
from mistletoe.span_token import SpanToken
|
||||||
|
|
||||||
|
|
||||||
|
class Dash(SpanToken):
|
||||||
|
"""
|
||||||
|
Dash span token ( - ).
|
||||||
|
Identifies a dash in a text.
|
||||||
|
"""
|
||||||
|
pattern = re.compile(r'(\s-\s)')
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import mistletoe
|
||||||
|
|
||||||
|
from renderer.fifty_ohm_html_renderer import FiftyOhmHtmlRenderer
|
||||||
|
from test.util import paragraph
|
||||||
|
|
||||||
|
|
||||||
|
def test_dash_html() :
|
||||||
|
|
||||||
|
assertions = {
|
||||||
|
"Foo - Bar" : "Foo – Bar",
|
||||||
|
}
|
||||||
|
|
||||||
|
for assertion in assertions:
|
||||||
|
assert mistletoe.markdown(assertion, FiftyOhmHtmlRenderer) == paragraph(assertions[assertion])
|
||||||
Reference in New Issue
Block a user