Подключил декодер html-entities
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import he from 'he';
|
||||
import sax from '../../../../server/core/BookConverter/sax';
|
||||
import {sleep} from '../../../share/utils';
|
||||
|
||||
@@ -134,7 +135,8 @@ export default class BookParser {
|
||||
};
|
||||
|
||||
const onTextNode = (text) => {// eslint-disable-line no-unused-vars
|
||||
text = text.replace(/ |[\t\n\r]/g, ' ');
|
||||
text = he.decode(text);
|
||||
text = text.replace(/[\t\n\r]/g, ' ');
|
||||
|
||||
if (text != ' ' && text.trim() == '')
|
||||
text = text.trim();
|
||||
|
||||
3
package-lock.json
generated
3
package-lock.json
generated
@@ -5230,8 +5230,7 @@
|
||||
"he": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="
|
||||
},
|
||||
"hex-color-regex": {
|
||||
"version": "1.1.0",
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
"fg-loadcss": "^2.1.0",
|
||||
"fs-extra": "^7.0.1",
|
||||
"got": "^9.5.1",
|
||||
"he": "^1.2.0",
|
||||
"iconv-lite": "^0.4.24",
|
||||
"localforage": "^1.7.3",
|
||||
"lodash": "^4.17.11",
|
||||
|
||||
Reference in New Issue
Block a user