mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-23 22:29:42 +12:00
Merge pull request #1205 from sagev9000/skip-comments-in-word-count
Skip comments in word count
This commit is contained in:
commit
dccfa85d1f
|
@ -30,7 +30,7 @@ def safeTranslate(qApp, group, text):
|
||||||
return text
|
return text
|
||||||
|
|
||||||
def wordCount(text):
|
def wordCount(text):
|
||||||
return len(re.findall(r"\S+", text))
|
return len(re.findall(r"\S+", re.sub(r"(<!--).+?(-->)", "", text)))
|
||||||
|
|
||||||
|
|
||||||
def charCount(text, use_spaces = True):
|
def charCount(text, use_spaces = True):
|
||||||
|
|
Loading…
Reference in a new issue