Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
mermaidjs#68 Class diagram parser breaks depending on length of conte…
Browse files Browse the repository at this point in the history
…nt between brackets
  • Loading branch information
Ashish Jain committed Nov 7, 2019
1 parent 2c885a6 commit 38f619e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ class Preview extends React.Component {
try {
mermaid.parse(code)
// Replacing special characters '<' and '>' with encoded '&lt;' and '&gt;'
let _code= code;
_code = _code.replace(/</g,'&lt;');
_code = _code.replace(/>/g,'&gt;');

// Overriding the innerHTML with the updated code string
this.container.innerHTML = _code;
let _code = code
_code = _code.replace(/</g, '&lt;')
_code = _code.replace(/>/g, '&gt;')
// Overriding the innerHTML with the updated code string
this.container.innerHTML = _code
mermaid.init(undefined, this.container)
} catch (e) {
// {str, hash}
Expand Down

0 comments on commit 38f619e

Please sign in to comment.