| 1 |
""" |
| 2 |
Python Markdown |
| 3 |
|
| 4 |
A Python implementation of John Gruber's Markdown. |
| 5 |
|
| 6 |
Documentation: https://python-markdown.github.io/ |
| 7 |
GitHub: https://github.com/Python-Markdown/markdown/ |
| 8 |
PyPI: https://pypi.org/project/Markdown/ |
| 9 |
|
| 10 |
Started by Manfred Stienstra (http://www.dwerg.net/). |
| 11 |
Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org). |
| 12 |
Currently maintained by Waylan Limberg (https://github.com/waylan), |
| 13 |
Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser). |
| 14 |
|
| 15 |
Copyright 2007-2023 The Python Markdown Project (v. 1.7 and later) |
| 16 |
Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) |
| 17 |
Copyright 2004 Manfred Stienstra (the original version) |
| 18 |
|
| 19 |
License: BSD (see LICENSE.md for details). |
| 20 |
""" |
| 21 |
|
| 22 |
from markdown.test_tools import TestCase |
| 23 |
|
| 24 |
|
| 25 |
class TestRawHtml(TestCase): |
| 26 |
def test_inline_html_angle_brackets(self): |
| 27 |
self.assertMarkdownRenders("<span>e<c</span>", "<p><span>e<c</span></p>") |
| 28 |
self.assertMarkdownRenders("<span>e>c</span>", "<p><span>e>c</span></p>") |
| 29 |
self.assertMarkdownRenders("<span>e < c</span>", "<p><span>e < c</span></p>") |
| 30 |
self.assertMarkdownRenders("<span>e > c</span>", "<p><span>e > c</span></p>") |
| 31 |
|
| 32 |
def test_inline_html_backslashes(self): |
| 33 |
self.assertMarkdownRenders('<img src="..\\..\\foo.png">', '<p><img src="..\\..\\foo.png"></p>') |
| 34 |
|
| 35 |
def test_noname_tag(self): |
| 36 |
self.assertMarkdownRenders('<span></></span>', '<p><span></></span></p>') |
| 37 |
|
| 38 |
def test_markdown_nested_in_inline_comment(self): |
| 39 |
self.assertMarkdownRenders( |
| 40 |
'Example: <!-- [**Bold link**](http://example.com) -->', |
| 41 |
'<p>Example: <!-- <a href="http://example.com"><strong>Bold link</strong></a> --></p>' |
| 42 |
) |