diff --git a/recommonmark/parser.py b/recommonmark/parser.py index 299c477..857aded 100644 --- a/recommonmark/parser.py +++ b/recommonmark/parser.py @@ -218,13 +218,19 @@ class CommonMarkParser(parsers.Parser): self.current_node.append(q) self.current_node = q - def visit_html_inline(self, mdnode): + def visit_html(self, mdnode): raw_node = nodes.raw(mdnode.literal, mdnode.literal, format='html') if mdnode.sourcepos is not None: raw_node.line = mdnode.sourcepos[0][0] self.current_node.append(raw_node) + def visit_html_inline(self, mdnode): + self.visit_html(mdnode) + + def visit_html_block(self, mdnode): + self.visit_html(mdnode) + def visit_thematic_break(self, _): self.current_node.append(nodes.transition()) diff --git a/tests/test_basic.py b/tests/test_basic.py index 8fa0142..545c097 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -403,7 +403,7 @@ class TestParsing(unittest.TestCase): """ ) - def test_html(self): + def test_html_inline(self): self.assertParses( """ Foo @@ -423,6 +423,26 @@ class TestParsing(unittest.TestCase): """ ) + def test_html_block(self): + self.assertParses( + """ + Foo + +
+ Blink +
+ """, + """ + + + Foo + <div> + <blink>Blink</blink> + </div> + + """ + ) + def test_eval(self): self.assertParses( """