mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Use underscore to escape XML
This commit is contained in:
parent
48e6d63158
commit
8bc950ba87
2 changed files with 5 additions and 2 deletions
|
|
@ -21,6 +21,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.11.2",
|
||||
"@types/underscore": "^1.11.4",
|
||||
"eslint-plugin-prettier": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -31,6 +32,7 @@
|
|||
"dotenv": "^16.0.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"linkedom": "^0.14.12",
|
||||
"microsoft-cognitiveservices-speech-sdk": "^1.22.0"
|
||||
"microsoft-cognitiveservices-speech-sdk": "^1.22.0",
|
||||
"underscore": "^1.13.4"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { parseHTML } from 'linkedom'
|
||||
import * as _ from 'underscore'
|
||||
|
||||
// this code needs to be kept in sync with the
|
||||
// frontend code in: useReadingProgressAnchor
|
||||
|
|
@ -59,7 +60,7 @@ function emit(textItems: string[], text: string) {
|
|||
}
|
||||
|
||||
function cleanTextNode(textNode: ChildNode): string {
|
||||
return (textNode.textContent ?? '').replace(/\s+/g, ' ')
|
||||
return _.escape(textNode.textContent ?? ''.replace(/\s+/g, ' '))
|
||||
}
|
||||
|
||||
function emitTextNode(
|
||||
|
|
|
|||
Loading…
Reference in a new issue