Fix paragraph counting

Markdown requires at least 2 newlines to form a paragraph.
github/fork/yochananmarqos/patch-1
Gonçalo Silva 2019-06-08 03:04:24 +01:00
parent 3f4f8292ca
commit 0d87299040
1 changed files with 2 additions and 2 deletions

View File

@ -23,8 +23,8 @@ class StatsCounter:
# exclamation mark, paragraph, and variants.
SENTENCES = re.compile(r"[^\n][.。।෴۔።?՞;⸮؟?፧꘏⳺⳻⁇﹖⁈⁉‽!﹗!՜߹႟᥄\n]+")
# Regexp that matches paragraphs, ie. anything separated by newlines.
PARAGRAPHS = re.compile(r".+\n?")
# Regexp that matches paragraphs, ie. anything separated by at least 2 newlines.
PARAGRAPHS = re.compile(r"[^\n]+(\n{2,}|$)")
# List of regexp whose matches should be replaced by their "text" group. Order is important.
MARKUP_REGEXP_REPLACE = (