Fix #1603 Remove entity-decode Dependency.

This commit is contained in:
Sidharth Vinod
2021-07-07 02:00:44 +05:30
parent 5070d992dd
commit 862330a576
4 changed files with 18 additions and 13 deletions

View File

@@ -2,8 +2,6 @@
* Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render
* the diagrams to svg code.
*/
// import { decode } from 'he';
import decode from 'entity-decode/browser';
import { log } from './logger';
import mermaidAPI from './mermaidAPI';
import utils from './utils';
@@ -98,7 +96,8 @@ const init = function() {
txt = element.innerHTML;
// transforms the html to pure text
txt = decode(txt)
txt = utils
.entityDecode(txt)
.trim()
.replace(/<br\s*\/?>/gi, '<br/>');