We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc4d06b commit 11ea1f8Copy full SHA for 11ea1f8
src/plugins/gitalk.js
@@ -7,10 +7,16 @@ function install(hook) {
7
const main = dom.getNode('#main')
8
div.style = `width: ${main.clientWidth}px; margin: 0 auto 20px;`
9
dom.appendTo(dom.find('.content'), div)
10
- const script = dom.create('script')
11
- const content = `gitalk.render('gitalk-container')`
12
- script.textContent = content
13
- dom.appendTo(dom.body, script)
+ })
+
+ hook.doneEach(_ => {
+ const el = document.getElementById('gitalk-container')
14
+ while (el.hasChildNodes()) {
15
+ el.removeChild(el.firstChild)
16
+ }
17
18
+ // eslint-disable-next-line
19
+ gitalk.render('gitalk-container')
20
})
21
}
22
0 commit comments