Skip to content

Commit 463b7b5

Browse files
Merge branch 'master' into allow-plus-sign-in-urls
2 parents 4baa6fc + 5a2b945 commit 463b7b5

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
## python-markdown2 2.5.4 (not yet released)
44

55
- [pull #617] Add MarkdownFileLinks extra (#528)
6+
- [pull #622] Add missing block tags to regex (#620)
67
- [pull #623] Don't escape plus signs in URLs (#621)
78

9+
810
## python-markdown2 2.5.3
911

1012
- [pull #616] make tables without body gfm compatible

lib/markdown2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,9 @@ def _detab(self, text: str) -> str:
859859

860860
# I broke out the html5 tags here and add them to _block_tags_a and
861861
# _block_tags_b. This way html5 tags are easy to keep track of.
862-
_html5tags = '|article|aside|header|hgroup|footer|nav|section|figure|figcaption'
862+
_html5tags = '|address|article|aside|canvas|figcaption|figure|footer|header|main|nav|section|video'
863863

864-
_block_tags_a = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del|style|html|head|body'
864+
_block_tags_a = 'blockquote|body|dd|del|div|dl|dt|fieldset|form|h[1-6]|head|hr|html|iframe|ins|li|math|noscript|ol|p|pre|script|style|table|tfoot|ul'
865865
_block_tags_a += _html5tags
866866

867867
_strict_tag_block_re = re.compile(r"""
@@ -877,7 +877,7 @@ def _detab(self, text: str) -> str:
877877
""" % _block_tags_a,
878878
re.X | re.M)
879879

880-
_block_tags_b = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math'
880+
_block_tags_b = 'blockquote|div|dl|fieldset|form|h[1-6]|iframe|math|noscript|ol|p|pre|script|table|ul'
881881
_block_tags_b += _html5tags
882882

883883
_span_tags = (
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<p>Some HTML5 block level elements that should be hashed so that smarty-pants doesn&#8217;t interfere</p>
2+
3+
<address>
4+
<a href="mailto:[email protected]">[email protected]</a><br />
5+
<a href="tel:+14155550132">+1 (415) 555‑0132</a>
6+
</address>
7+
8+
<canvas width="120" height="120">
9+
An alternative text describing what your canvas displays.
10+
</canvas>
11+
12+
<video height="640" width="382" controls loop>
13+
<source src="images/door.mp4" type="video/mp4"/>
14+
Test
15+
</video>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"extras": ["smarty-pants"]}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Some HTML5 block level elements that should be hashed so that smarty-pants doesn't interfere
2+
3+
<address>
4+
<a href="mailto:[email protected]">[email protected]</a><br />
5+
<a href="tel:+14155550132">+1 (415) 555‑0132</a>
6+
</address>
7+
8+
<canvas width="120" height="120">
9+
An alternative text describing what your canvas displays.
10+
</canvas>
11+
12+
<video height="640" width="382" controls loop>
13+
<source src="images/door.mp4" type="video/mp4"/>
14+
Test
15+
</video>

0 commit comments

Comments
 (0)