| 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 TestLegacyAtrributes(TestCase): |
| 26 |
|
| 27 |
maxDiff = None |
| 28 |
|
| 29 |
def testLegacyAttrs(self): |
| 30 |
self.assertMarkdownRenders( |
| 31 |
self.dedent(""" |
| 32 |
# Header {@id=inthebeginning} |
| 33 |
|
| 34 |
Now, let's try something *inline{@class=special}*, to see if it works |
| 35 |
|
| 36 |
@id=TABLE.OF.CONTENTS} |
| 37 |
|
| 38 |
|
| 39 |
* {@id=TABLEOFCONTENTS} |
| 40 |
|
| 41 |
|
| 42 |
Or in the middle of the text {@id=TABLEOFCONTENTS} |
| 43 |
|
| 44 |
{@id=tableofcontents} |
| 45 |
|
| 46 |
[](http://fourthought.com/) |
| 49 |
|
| 50 |
![img{@id=foo}][img] |
| 51 |
|
| 52 |
[img]: http://example.com/i.jpg |
| 53 |
"""), |
| 54 |
self.dedent(""" |
| 55 |
<h1 id="inthebeginning">Header </h1> |
| 56 |
<p>Now, let's try something <em class="special">inline</em>, to see if it works</p> |
| 57 |
<p>@id=TABLE.OF.CONTENTS}</p> |
| 58 |
<ul> |
| 59 |
<li id="TABLEOFCONTENTS"></li> |
| 60 |
</ul> |
| 61 |
<p id="TABLEOFCONTENTS">Or in the middle of the text </p> |
| 62 |
<p id="tableofcontents"></p> |
| 63 |
<p><a href="http://fourthought.com/"><img alt="" src="http://fourthought.com/images/ftlogo.png" style="float: left; margin: 10px; border: none;" title="Fourthought logo" /></a></p> |
| 64 |
<p><img alt="img" id="foo" src="http://example.com/i.jpg" /></p> |
| 65 |
"""), # noqa: E501 |
| 66 |
extensions=['legacy_attrs'] |
| 67 |
) |