Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ditor into develop

* 'master' of https://github.com/mermaid-js/mermaid-live-editor:
  Bump normalize-url from 4.5.0 to 4.5.1
  Fix typo in grammer
  Fix CVE
  • Loading branch information
sidharthv96 committed Jun 12, 2021
2 parents 6c8c0f2 + abde98b commit 4f52a37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/editor/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const initEditor = (monacoEditor): void => {
'gitGraph',
'journey'
],
keywords: ['patricipant', 'as'],
keywords: ['participant', 'as'],
arrows: ['---', '===', '-->', '==>', '->>', '->'],
tokenizer: {
root: [
Expand Down
6 changes: 2 additions & 4 deletions src/lib/components/view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { onMount } from 'svelte';
import type { Mermaid } from 'mermaid';
const mermaid: Mermaid = (window.mermaid as unknown) as Mermaid;
const mermaid: Mermaid = window.mermaid as unknown as Mermaid;
let code = '';
let container: HTMLDivElement;
let error = false;
Expand All @@ -20,10 +20,8 @@
}
outOfSync = false;
manualUpdate = true;
// Replacing special characters '<' and '>' with encoded '&lt;' and '&gt;'
code = state.code; //.replace(/</g, '&lt;').replace(/>/g, '&gt;');
code = state.code;
const scroll = container.parentElement.parentElement.parentElement.scrollTop;
container.innerHTML = code;
delete container.dataset.processed;
mermaid.initialize(Object.assign({}, JSON.parse(state.mermaid)));
mermaid.render('graph-div', code, (svgCode) => {
Expand Down

0 comments on commit 4f52a37

Please sign in to comment.