mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-21 23:03:11 -05:00
Replace nbsp with regular sp when extracting text
The nbsp are used by the browser to stop HTML white space collapsing from applying, but we don't want them in the plain text version.
This commit is contained in:
parent
3937c10b55
commit
96e4bf2e98
1 changed files with 3 additions and 0 deletions
|
@ -53,6 +53,9 @@ const getTextContentsOfRange = (range: Range) => {
|
|||
}
|
||||
node = walker.nextNode();
|
||||
}
|
||||
// Replace nbsp with regular space;
|
||||
// eslint-disable-next-line no-irregular-whitespace
|
||||
textContent = textContent.replace(/ /g, ' ');
|
||||
|
||||
return textContent;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue