Merge pull request #1205 from sagev9000/skip-comments-in-word-count

Skip comments in word count
This commit is contained in:
Tobias Frisch 2023-08-25 23:06:48 +02:00 committed by GitHub
commit dccfa85d1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,7 +30,7 @@ def safeTranslate(qApp, group, text):
return 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):