Skip to content

Commit

Permalink
fix assert
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-kirkbride committed Jul 2, 2023
1 parent a1479f6 commit c27e782
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions porcupine/plugins/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ def _is_list_item(line: str) -> bool:
- https://spec.commonmark.org/0.30/#lists
- https://pandoc.org/MANUAL.html#lists
"""
assert isinstance(line, str)
if not line:
# empty string
return False

assert len(line.splitlines()) == 1

pattern = r"(^\s*\d{1,9}[.)]|^\s*[-+*]|^\s*#\)|^\s*#\.) .*"
regex = re.compile(pattern)
match = regex.search(line)
Expand Down

0 comments on commit c27e782

Please sign in to comment.