aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/editor.mjs5
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
34const initialState = getStateFromHash(window.location.hash) 34const initialState = getStateFromHash(window.location.hash)
35const queryParams = new URL(window.location).searchParams
35window.location.hash = '' 36window.location.hash = ''
36const contentFromHash = initialState.content 37const contentFromHash = initialState.content
37const lastContent = localStorage.getItem('editorContent') 38const lastContent = localStorage.getItem('editorContent')
@@ -82,6 +83,10 @@ const cm = editor.codemirror
82markdown2HTML(HtmlContainer, editor.value()) 83markdown2HTML(HtmlContainer, editor.value())
83createDocLinks(HtmlContainer) 84createDocLinks(HtmlContainer)
84 85
86if (queryParams.get('render')) {
87 toggleMaps(HtmlContainer)
88}
89
85// Re-render HTML by editor content 90// Re-render HTML by editor content
86cm.on("change", () => { 91cm.on("change", () => {
87 markdown2HTML(HtmlContainer, editor.value()) 92 markdown2HTML(HtmlContainer, editor.value())