Skip to content

Commit dd2fac0

Browse files
committed
simplify setext heading regex: [=]+ → =+ and [-]+ → -+
The character class form [=]+ and [=]+ are equivalent to =+ and =+ respectively, but the bare form is cleaner per mitya57's review suggestion on PR Python-Markdown#1606.
1 parent 65666a6 commit dd2fac0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

markdown/blockprocessors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ class SetextHeaderProcessor(BlockProcessor):
494494
""" Process Setext-style Headers. """
495495

496496
# Detect Setext-style header. Must be first 2 lines of block.
497-
RE = re.compile(r'^.*?\n(?:[=]+|[-]+)[ ]*(\n|$)', re.MULTILINE)
497+
RE = re.compile(r'^.*?\n(?:=+|-+)[ ]*(\n|$)', re.MULTILINE)
498498

499499
def test(self, parent: etree.Element, block: str) -> bool:
500500
return bool(self.RE.match(block))

0 commit comments

Comments
 (0)