(chunk: string)
| 653 | } |
| 654 | |
| 655 | #normalizeLineEndings(chunk: string): string { |
| 656 | const version = this.#xml11 ? "1.1" : "1.0"; |
| 657 | const needsNormalization = this.#xml11 |
| 658 | ? chunk.includes("\r") || chunk.includes("\x85") || |
| 659 | chunk.includes("\u2028") |
| 660 | : chunk.includes("\r"); |
| 661 | |
| 662 | return needsNormalization |
| 663 | ? chunk.replace(LINE_ENDING_REGEXP[version], "\n") |
| 664 | : chunk; |
| 665 | } |
| 666 | |
| 667 | /** |
| 668 | * Process accumulated keyword in ENTITY declaration. |