1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Remove non-displayable chars from outline title (#14267)

- it aims to fix #14267;
 - there is nothing about chars in range [0-1F] in the specs but acrobat doesn't display them in any way.
This commit is contained in:
Calixte Denizet 2021-11-12 19:41:32 +01:00
parent 7d6d3fc124
commit 7041c62ccf
6 changed files with 38 additions and 3 deletions

View file

@ -59,7 +59,12 @@ class BaseTreeViewer {
* @private
*/
_normalizeTextContent(str) {
return removeNullCharacters(str) || /* en dash = */ "\u2013";
// Chars in range [0x01-0x1F] will be replaced with a white space
// and 0x00 by "".
return (
removeNullCharacters(str, /* replaceInvisible */ true) ||
/* en dash = */ "\u2013"
);
}
/**