| 1625 | |
| 1626 | // Checks that the text run `s[i, j)` outside the root element is whitespace |
| 1627 | private whitespace(s: string, i: number, j: number): void { |
| 1628 | for (let k = i; k < j; k++) { |
| 1629 | if (!isSpace(s.charCodeAt(k))) { |
| 1630 | throw this.syntax(this.state === PROLOG ? "text before the root element" : "text after the root element", k) |
| 1631 | } |
| 1632 | } |
| 1633 | } |
| 1634 | |
| 1635 | // Replaces references and normalizes line endings, or attribute whitespace. |
| 1636 | // `whitespace` is false when `raw` has nothing to normalize. |