Skip to content

Commit 105fbbf

Browse files
committed
Updates per request
- When Vue.js is detected, markdown `<script>` is not executed when executeScript is `false` (matches previous behavior) - Minor code tweaks that do not affect functonality
1 parent dd88248 commit 105fbbf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/core/render/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ function renderMain(html) {
5151
!this.config.loadSidebar && this._renderSidebar();
5252

5353
// Execute markdown <script>
54-
if (this.config.executeScript || 'Vue' in window) {
54+
if (
55+
this.config.executeScript ||
56+
('Vue' in window && this.config.executeScript !== false)
57+
) {
5558
executeScript();
5659
}
5760

@@ -62,15 +65,13 @@ function renderMain(html) {
6265

6366
for (let i = 0, len = childElms.length; i < len; i++) {
6467
const elm = childElms[i];
65-
const isValid = ['SCRIPT'].indexOf(elm.tagName) === -1;
68+
const isValid = elm.tagName !== 'SCRIPT';
6669
const isVue = Boolean(elm.__vue__ && elm.__vue__._isVue);
6770

6871
if (isValid && !isVue) {
6972
new window.Vue({
7073
mounted: function() {
71-
if (this.$children.length === 0) {
72-
this.$destroy;
73-
}
74+
this.$destroy;
7475
},
7576
}).$mount(elm);
7677
}

0 commit comments

Comments
 (0)