Skip to content

Commit 9e72063

Browse files
committed
fix: prevent remove unicode whitespace when parsing atx heading
ref #414
1 parent cd1ad91 commit 9e72063

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mistune/block_parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import re
22
from typing import Optional, List, Tuple, Match, Pattern
3+
import string
34
from .util import (
45
unikey,
56
escape_url,
@@ -185,7 +186,7 @@ def parse_atx_heading(self, m: Match[str], state: BlockState) -> int:
185186
"""Parse token for ATX heading. An ATX heading is started with 1 to 6
186187
symbol of ``#``."""
187188
level = len(m.group("atx_1"))
188-
text = m.group("atx_2").strip()
189+
text = m.group("atx_2").strip(string.whitespace)
189190
# remove last #
190191
if text:
191192
text = _ATX_HEADING_TRIM.sub("", text)

0 commit comments

Comments
 (0)