Commit 1c73a182 authored by Michal Čihař's avatar Michal Čihař

Do not highlight invalid XML

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 1eabc8c8
......@@ -121,6 +121,10 @@ class XMLTagsCheck(TargetCheck):
def check_highlight(self, source, unit):
ret = []
try:
self.parse_xml(source)
except SyntaxError:
return ret
for match in XML_MATCH.finditer(source):
ret.append((match.start(), match.end(), match.group()))
for match in XML_ENTITY_MATCH.finditer(source):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment