()
| 185 | } |
| 186 | |
| 187 | private readCdata(): void { |
| 188 | const startIndex = this.index + '<![CDATA['.length; |
| 189 | const endIndex = this.xml.indexOf(']]>', startIndex); |
| 190 | if (endIndex === -1) throw new Error('CDATA section is not closed.'); |
| 191 | this.appendText(this.xml.slice(startIndex, endIndex), false); |
| 192 | this.index = endIndex + ']]>'.length; |
| 193 | } |
| 194 | |
| 195 | private appendText(text: string, decodeEntities: boolean): void { |
| 196 | const trimmed = text.trim(); |
no test coverage detected