Подключил декодер html-entities

This commit is contained in:
Book Pauk
2019-02-04 15:47:53 +07:00
parent 8fef53d35e
commit 170c06fa3f
3 changed files with 5 additions and 3 deletions

View File

@@ -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();