File tree Expand file tree Collapse file tree 3 files changed +62
-3
lines changed
tests/test_syntax/extensions Expand file tree Collapse file tree 3 files changed +62
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ The following new features have been included in the release:
3131
3232The following bug fixes are included in the 3.1 release:
3333
34+ * Overlapping raw HTML matches no longer leave placeholders behind (#458 ).
3435* Emphasis patterns now recognize newline characters as whitespace (#783 ).
3536* Version format had been updated to be PEP 440 compliant (#736 ).
3637* Block level elements are defined per instance, not as class attributes
Original file line number Diff line number Diff line change @@ -81,9 +81,14 @@ def run(self, text):
8181
8282 if replacements :
8383 pattern = re .compile ("|" .join (re .escape (k ) for k in replacements ))
84- text = pattern .sub (lambda m : replacements [m .group (0 )], text )
85-
86- return text
84+ processed_text = pattern .sub (lambda m : replacements [m .group (0 )], text )
85+ else :
86+ return text
87+
88+ if processed_text == text :
89+ return processed_text
90+ else :
91+ return self .run (processed_text )
8792
8893 def isblocklevel (self , html ):
8994 m = re .match (r'^\<\/?([^ >]+)' , html )
Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+ """
3+ Python Markdown
4+
5+ A Python implementation of John Gruber's Markdown.
6+
7+ Documentation: https://python-markdown.github.io/
8+ GitHub: https://github.com/Python-Markdown/markdown/
9+ PyPI: https://pypi.org/project/Markdown/
10+
11+ Started by Manfred Stienstra (http://www.dwerg.net/).
12+ Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org).
13+ Currently maintained by Waylan Limberg (https://github.com/waylan),
14+ Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser).
15+
16+ Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later)
17+ Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
18+ Copyright 2004 Manfred Stienstra (the original version)
19+
20+ License: BSD (see LICENSE.md for details).
21+ """
22+
23+ from __future__ import unicode_literals
24+ from markdown .test_tools import TestCase
25+
26+
27+ class TestFencedCode (TestCase ):
28+
29+ # TODO: Move the rest of the fenced code tests here.
30+
31+ def test_fenced_code_in_raw_html (self ):
32+ self .assertMarkdownRenders (
33+ self .dedent (
34+ """
35+ <details>
36+ ```
37+ Begone placeholders!
38+ ```
39+ </details>
40+ """
41+ ),
42+ self .dedent (
43+ """
44+ <details>
45+
46+ <pre><code>Begone placeholders!
47+ </code></pre>
48+
49+ </details>
50+ """
51+ ),
52+ extensions = ['fenced_code' ]
53+ )
You can’t perform that action at this time.
0 commit comments