mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Handle all the whitespaces the same way when creating text chunks
This commit is contained in:
parent
9bb636402a
commit
9dae421a0d
3 changed files with 27 additions and 11 deletions
|
@ -1640,7 +1640,17 @@ function reverseIfRtl(chars) {
|
|||
return buf.join("");
|
||||
}
|
||||
|
||||
const SpecialCharRegExp = new RegExp("^(\\s)|(\\p{Mn})$", "u");
|
||||
function getCharUnicodeCategory(char) {
|
||||
const groups = char.match(SpecialCharRegExp);
|
||||
return {
|
||||
isWhitespace: !!(groups && groups[1]),
|
||||
isDiacritic: !!(groups && groups[2]),
|
||||
};
|
||||
}
|
||||
|
||||
export {
|
||||
getCharUnicodeCategory,
|
||||
getNormalizedUnicodes,
|
||||
getUnicodeForGlyph,
|
||||
getUnicodeRangeFor,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue