()
| 116 | } |
| 117 | |
| 118 | private readOpeningTagBody(): { attributes: Record<string, string>; selfClosing: boolean } { |
| 119 | const attributes: Record<string, string> = {}; |
| 120 | while (true) { |
| 121 | this.skipWhitespace(); |
| 122 | const tagEnd = this.readOpeningTagEnd(); |
| 123 | if (tagEnd) return { attributes, selfClosing: tagEnd === 'self-closing' }; |
| 124 | const attribute = this.readAttribute(); |
| 125 | attributes[attribute.name] = attribute.value; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | private readOpeningTagEnd(): 'open' | 'self-closing' | null { |
| 130 | if (this.index >= this.xml.length) throw new Error('Opening XML tag is not closed.'); |
no test coverage detected