diff options
| -rw-r--r-- | src/editor.mjs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/editor.mjs b/src/editor.mjs index 9b245d8..beee35b 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
| @@ -32,6 +32,7 @@ const getContentFromHash = (hash) => { | |||
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | const initialState = getStateFromHash(window.location.hash) | 34 | const initialState = getStateFromHash(window.location.hash) |
| 35 | const queryParams = new URL(window.location).searchParams | ||
| 35 | window.location.hash = '' | 36 | window.location.hash = '' |
| 36 | const contentFromHash = initialState.content | 37 | const contentFromHash = initialState.content |
| 37 | const lastContent = localStorage.getItem('editorContent') | 38 | const lastContent = localStorage.getItem('editorContent') |
| @@ -82,6 +83,10 @@ const cm = editor.codemirror | |||
| 82 | markdown2HTML(HtmlContainer, editor.value()) | 83 | markdown2HTML(HtmlContainer, editor.value()) |
| 83 | createDocLinks(HtmlContainer) | 84 | createDocLinks(HtmlContainer) |
| 84 | 85 | ||
| 86 | if (queryParams.get('render')) { | ||
| 87 | toggleMaps(HtmlContainer) | ||
| 88 | } | ||
| 89 | |||
| 85 | // Re-render HTML by editor content | 90 | // Re-render HTML by editor content |
| 86 | cm.on("change", () => { | 91 | cm.on("change", () => { |
| 87 | markdown2HTML(HtmlContainer, editor.value()) | 92 | markdown2HTML(HtmlContainer, editor.value()) |