Fix single-quoted string being badly recongnized as attribute value in XML

Fix #3403
This commit is contained in:
Don HO 2020-11-19 16:09:59 +01:00
parent 7874f8dab3
commit cabf726778
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -50,6 +50,7 @@ vector< pair<int, int> > 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<int, int> > 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:
{