diff --git a/uberwriter/stats_counter.py b/uberwriter/stats_counter.py index ec54095..b37ec65 100644 --- a/uberwriter/stats_counter.py +++ b/uberwriter/stats_counter.py @@ -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 = (