From cabf726778c1ac7eb31513808010b42ecfbf95b3 Mon Sep 17 00:00:00 2001 From: Don HO Date: Thu, 19 Nov 2020 16:09:59 +0100 Subject: [PATCH] Fix single-quoted string being badly recongnized as attribute value in XML Fix #3403 --- .../xmlMatchedTagsHighlighter.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp index 116ae7f2..7d6e6551 100644 --- a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp +++ b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp @@ -50,6 +50,7 @@ vector< pair > XmlMatchedTagsHighlighter::getAttributesPos(int start, attr_pre_assign,\ attr_assign,\ attr_string,\ + attr_single_quot_string,\ attr_value,\ attr_valid\ } state = attr_invalid; @@ -98,6 +99,20 @@ vector< pair > XmlMatchedTagsHighlighter::getAttributesPos(int start, state = attr_string; } break; + + case '\'': + { + if (state == attr_single_quot_string) + { + state = attr_valid; + oneMoreChar = 1; + } + else if (state == attr_key || state == attr_pre_assign || state == attr_value) + state = attr_invalid; + else if (state == attr_assign) + state = attr_single_quot_string; + } + break; default: {