From e44491139f204c83fd68babb36e0480dc8f47854 Mon Sep 17 00:00:00 2001 From: trendschau Date: Sat, 5 Mar 2022 21:45:04 +0100 Subject: [PATCH] Fix shortcode component with no attributes --- system/author/js/vue-blox.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/system/author/js/vue-blox.js b/system/author/js/vue-blox.js index 228e2a0..766a9e7 100644 --- a/system/author/js/vue-blox.js +++ b/system/author/js/vue-blox.js @@ -794,7 +794,7 @@ const shortcodeComponent = Vue.component('shortcode-component', { '
' + '
' + '' + - '' + + '' + '
' + '' + '' + @@ -857,14 +857,18 @@ const shortcodeComponent = Vue.component('shortcode-component', { } } }, - createmarkdown: function(shortcodename,attribute) + createmarkdown: function(shortcodename,attribute = false) { + var attributes = ''; - for (var attribute in this.shortcodedata[shortcodename]) + if(attribute) { - if(this.shortcodedata[shortcodename].hasOwnProperty(attribute)) + for (var attribute in this.shortcodedata[shortcodename]) { - attributes += ' ' + attribute + '="' + this.shortcodedata[shortcodename][attribute].value + '"'; + if(this.shortcodedata[shortcodename].hasOwnProperty(attribute)) + { + attributes += ' ' + attribute + '="' + this.shortcodedata[shortcodename][attribute].value + '"'; + } } }