Merge pull request #1212 from sagev9000/skip-comments-fix

Fix regex for ignoring multi-line comments.
This commit is contained in:
Tobias Frisch 2023-09-05 14:59:16 +02:00 committed by GitHub
commit 87da52efd4
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+", re.sub(r"(<!--).+?(-->)", "", text)))
return len(re.findall(r"\S+", re.sub(r"(<!--).+?(-->)", "", text, flags=re.DOTALL)))
def charCount(text, use_spaces = True):