diff --git a/dist/vue-code-highlight.esm.js b/dist/vue-code-highlight.esm.js index f7f3e44..a9361a7 100644 --- a/dist/vue-code-highlight.esm.js +++ b/dist/vue-code-highlight.esm.js @@ -785,9 +785,11 @@ var CodeHighlight = {render: function(){var _vm=this;var _h=_vm.$createElement;v }, beforeUpdate: function beforeUpdate() { - var newText = this.$slots.default[0].text.replace(/^[\r\n\s]*|[\r\n\s]*$/g, ''); - this.$el.querySelector('code').textContent = newText; - Prism.highlightAllUnder(this.$refs.codeBlock); + if(this.$slots.default[0].text){ + var newText = this.$slots.default[0].text.replace(/^[\r\n\s]*|[\r\n\s]*$/g, ''); + this.$el.querySelector('code').textContent = newText; + Prism.highlightAllUnder(this.$refs.codeBlock); + } }, }; diff --git a/package-lock.json b/package-lock.json index eb39cf3..eeb59ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-code-highlight", - "version": "0.7.7", + "version": "0.7.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d4b8028..7d0f44e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-code-highlight", - "version": "0.7.7", + "version": "0.7.8", "author": "Jan BĂ­lek", "email": "honza@elision.design", "url": "https://elision.design/",