QCodeEditor icon indicating copy to clipboard operation
QCodeEditor copied to clipboard

RegEx does not always find correct start of an attribute

Open MrBeee opened this issue 2 years ago • 0 comments

I'm using QGIS an Open-Source GIS application, that allows you to write a Coordinate Reference System (CRS) to a QDom element, using its WriteXml() function. This produces a WKT string that QCodeEditor incorrectly interprets as the start of an xml attribute. The reason for this is (I believe) that the start of an xml-attribute is simply determined by QRegExp("""). Instead, the expression should first look back one character, to check if this double quote has been preceded by an '=' sign. If not, then the attribute hasn't started yet. Please have a look at the attached xml snippet and load it in QCodeEditor to see what I mean. Please note that I don't use text wrapping in my QCodeEditor widget.

Cheers, Bart

xml-snippet.txt

MrBeee avatar Oct 27 '22 08:10 MrBeee