Closed luxifer closed 7 years ago
I get this error
Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 556, in run_ return self.run(edit) File "indentxml in C:\Users\lquispe\AppData\Roaming\Sublime Text 3\Installed Packages\Indent XML.sublime-package", line 49, in run File "indentxml in C:\Users\lquispe\AppData\Roaming\Sublime Text 3\Installed Packages\Indent XML.sublime-package", line 96, in indent File "indentxml in C:\Users\lquispe\AppData\Roaming\Sublime Text 3\Installed Packages\Indent XML.sublime-package", line 93, in indent File "./xml/dom/minidom.py", line 1970, in parseString File "./xml/dom/expatbuilder.py", line 926, in parseString File "./xml/dom/expatbuilder.py", line 221, in parseString xml.parsers.expat.ExpatError: mismatched tag: line 1, column 616
Also failed to indend a xml with an & inside CDATA.
Note that XML in CDATA need to be quoted, so XML need to be valid to be indented. Also it is a good practice to attach sample XML to the issue, it is hard to diagnose issue.
@alek-sys All characters in CDATA should be allowed. That is the whole purpose of Cdata. But when CDATA contains special characters (like '&' ) this sublime package does not work.
@nelreina I was going to point you to the XML spec CDATA section.. and turned out you are quite right, spec clearly says "Within a CDATA section, only the CDEnd string is recognized as markup, so that left angle brackets and ampersands may occur in their literal form; they need not (and cannot) be escaped using "<" and "&".
So ok, this is an issue in xml.minidom - I'll look what can be done here.
I think this still fails. Here you have a sample http://pastebin.com/YWZsVjRA
Still fails with CDATA. Another sample: http://pastebin.com/9BJ1mWpN
I have the same issue, most of our XMLs use CDATA with HTML inside so the plugin quite rarely works
Also this guy talked about it in the sublimetext forums and gives an easy test case if needed
Brace yourself, the fix is coming!
And seriously, all these issues have the same reason which will be fixed next week, I'll release updated version from another branch. It does mindom monkey-patching instead of doing weird CDATA substitutions so everything will finally work.
Sublime version: 3