You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(file-parsers): stop deleting non-BMP characters when sanitizing parsed text (#6442)
* fix(file-parsers): stop deleting non-BMP characters when sanitizing parsed text
The unpaired-surrogate strip used a bare [\uD800-\uDFFF] class, which matches
UTF-16 code units and so removed both halves of every valid surrogate pair —
deleting all emoji, CJK Extension B, and mathematical alphanumerics from parsed
output. Match only genuinely unpaired surrogates instead.
Also surface PDF truncation inline. Callers read only `content`, so a bounded
PDF was indistinguishable from a complete one; it now carries the same
`[... ... ...]` marker csv and xlsx already use, via a shared helper.
Drop two unused exports, one of which carried the same surrogate bug.
* fix(file-parsers): keep text-free PDFs empty and count only pages that were read
Gate the truncation notice on the sanitized, trimmed body: a text-free
multi-page PDF collapses to a lone separator, so the previous length check let
a notice turn a document callers treat as empty into one that looks like it
holds content.
Also stop counting a page the budget cut off before it yielded anything, so the
notice no longer reports one more page than was shown.
0 commit comments