* Remove data that has already been consumed from the buffer.
()
| 1096 | * Remove data that has already been consumed from the buffer. |
| 1097 | */ |
| 1098 | private cleanup() { |
| 1099 | class="cm">// If we are inside of text or attributes, emit what we already have. |
| 1100 | if (this.sectionStart !== this.index) { |
| 1101 | if ( |
| 1102 | this.state === State.Text || |
| 1103 | (this.state === State.InRCDATA && this.sequenceIndex === 0) |
| 1104 | ) { |
| 1105 | this.cbs.ontext(this.sectionStart, this.index) |
| 1106 | this.sectionStart = this.index |
| 1107 | } else if ( |
| 1108 | this.state === State.InAttrValueDq || |
| 1109 | this.state === State.InAttrValueSq || |
| 1110 | this.state === State.InAttrValueNq |
| 1111 | ) { |
| 1112 | this.cbs.onattribdata(this.sectionStart, this.index) |
| 1113 | this.sectionStart = this.index |
| 1114 | } |
| 1115 | } |
| 1116 | } |
| 1117 | |
| 1118 | private finish() { |
| 1119 | if (!__BROWSER__ && this.state === State.InEntity) { |
no test coverage detected