diff --git a/manuskript/functions/__init__.py b/manuskript/functions/__init__.py index eb96253..e5a0e6c 100644 --- a/manuskript/functions/__init__.py +++ b/manuskript/functions/__init__.py @@ -30,7 +30,19 @@ def safeTranslate(qApp, group, text): return text def wordCount(text): - return len(re.findall(r"\S+", text)) + words = re.findall(r"\S+", text) + count = 0 + in_comment = False + for word in words: + if in_comment: + if word == '-->': + in_comment = False + else: + if word == '