We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 89f0b1f commit 3ec7c89Copy full SHA for 3ec7c89
src/render.js
@@ -112,12 +112,13 @@ export function renderArticle (content) {
112
document.body.querySelectorAll('article>script'))
113
.filter(script => !/template/.test(script.type)
114
)[0]
115
+ const code = script ? script.innerText.trim() : null
116
- CACHE.vm = script
117
- ? new Function(`return ${script.innerText.trim()}`)()
+ script && script.remove()
118
+ CACHE.vm = code
119
+ ? new Function(`return ${code}`)()
120
: new Vue({ el: 'main' }) // eslint-disable-line
121
CACHE.vm && CACHE.vm.$nextTick(_ => event.scrollActiveSidebar())
- script && script.remove()
122
}
123
if (OPTIONS.auto2top) setTimeout(() => event.scroll2Top(OPTIONS.auto2top), 0)
124
0 commit comments