(chunk: string)
| 604 | } |
| 605 | |
| 606 | #normalizeLineEndings(chunk: string): string { |
| 607 | const version = this.#xml11 ? "1.1" : "1.0"; |
| 608 | const needsNormalization = this.#xml11 |
| 609 | ? chunk.includes("\r") || chunk.includes("\x85") || |
| 610 | chunk.includes("\u2028") |
| 611 | : chunk.includes("\r"); |
| 612 | |
| 613 | return needsNormalization |
| 614 | ? chunk.replace(LINE_ENDING_REGEXP[version], "\n") |
| 615 | : chunk; |
| 616 | } |
| 617 | |
| 618 | /** |
| 619 | * Process accumulated keyword in ENTITY declaration. |