{{ message }}
Commit 21e2420
buffer: normalize lone "\r" in Blob native line endings
`new Blob(parts, { endings: 'native' })` failed to normalize a
standalone carriage return. The replacement regex only matched
`\n` and `\r\n`, so a lone `\r` (and runs such as `\r\r`) were
left untouched instead of being converted to the platform's
native line ending.
The WHATWG "convert line endings to native" algorithm requires
`\r`, `\n`, and `\r\n` to all be normalized. Match `\r\n` before
a lone `\r` so that CRLF collapses to a single native ending.
Refs: https://w3c.github.io/FileAPI/#convert-line-endings-to-native
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com>
PR-URL: #64115
Refs: https://w3c.github.io/FileAPI/#convert-line-endings-to-native
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>1 parent 59af7e0 commit 21e2420
2 files changed
Lines changed: 19 additions & 1 deletion

0 commit comments