1
0
mirror of https://github.com/ONLYOFFICE/sdkjs.git synced 2025-04-18 14:24:11 +03:00
Fix parsing of comments and CDATA in xml
This commit is contained in:
Ilya Kirillov 2025-03-11 14:53:39 +03:00
parent 7ce2afbe28
commit 11bf2e5f0c

10
vendor/easysax.js vendored
View File

@ -1215,7 +1215,15 @@ StaxParser.prototype.next = function() {
// ---------------------------------------------
var w = this.xml.charCodeAt(i + 1);
if (w === 33) { // 33 == "!"
this.index = this.xml.indexOf('>', i);
if (i + 3 < this.length && 45 === this.xml.charCodeAt(i + 2) && 45 === this.xml.charCodeAt(i + 3)) { // COMMENT
this.index = this.xml.indexOf('-->', i) + 3;
} else { // CDATA
this.index = this.xml.indexOf(']]>', i) + 3;
}
if (-1 === this.index) {
this.stop = true;
}
this.eventType = EasySAXEvent.Unknown;
return this.eventType;
}
// QUESTION