MCPcopy
hub / github.com/isso-comments/isso / test_code_blocks

Method test_code_blocks

isso/tests/test_html_misaka.py:100–118  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

98 self.assertEqual("<p>foo_bar_baz</p>", convert.render("foo_bar_baz"))
99
100 def test_code_blocks(self):
101 convert = MisakaMarkdown()
102 examples = [
103 (
104 "```\nThis is a code-fence. <hello>\n```",
105 "<p><pre><code>This is a code-fence. &lt;hello&gt;\n</code></pre></p>",
106 ),
107 (
108 "```cpp\nThis is a code-fence. <hello>\n```",
109 '<p><pre><code class="language-cpp">This is a code-fence. &lt;hello&gt;\n</code></pre></p>',
110 ),
111 (
112 " This is a four-character indent. <hello>",
113 "<p><pre><code>This is a four-character indent. &lt;hello&gt;\n</code></pre></p>",
114 ),
115 ]
116
117 for markup, expected in examples:
118 self.assertEqual(expected, convert.render(markup))

Callers

nothing calls this directly

Calls 2

MisakaMarkdownClass · 0.90
renderMethod · 0.45

Tested by

no test coverage detected