Merge pull request #1576 from omnivore-app/fix/highlight-spacing

Fix issue with spaces dissapearing when highlights are created
This commit is contained in:
Jackson Harper 2022-12-28 15:27:13 +08:00 committed by GitHub
commit c75867464b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,7 +126,7 @@ export function makeHighlightNodeAttributes(
// If we are not in preformatted text, prevent hardcoded \n,
// we'll create new-lines based on the startsParagraph data
const text = isPre ? rawText : rawText.replace(/\n/g, '')
const newTextNode = document.createTextNode(text)
const newTextNode = document.createTextNode(rawText)
if (!highlight) {
return parentNode?.insertBefore(newTextNode, nextSibling)