Skip to content

Commit 7c1483c

Browse files
committed
formatting: reduce false positive markdown-heading matches
1 parent d5281a3 commit 7c1483c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sopel_modules/github/formatting.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
LOGGER = tools.get_logger('github')
3737

38+
MARKDOWN_HEADING = re.compile(r'#+\s+')
39+
3840

3941
def fmt_url(s, row=None):
4042
if not row:
@@ -81,7 +83,7 @@ def fmt_short_comment_body(body):
8183
for line in body.splitlines()
8284
if line
8385
and line[0] != '>' # Markdown quote
84-
and not line.startswith('#') # Markdown heading
86+
and not MARKDOWN_HEADING.match(line) # Markdown heading
8587
and not line.startswith('<!-') # commented out HTML-style
8688
]
8789
# if there's nothing left, the comment is "empty"

0 commit comments

Comments
 (0)