diff --git a/html_resources/code-block/code-block.js b/html_resources/code-block/code-block.js index 3cf0f74..2c0e4f0 100644 --- a/html_resources/code-block/code-block.js +++ b/html_resources/code-block/code-block.js @@ -21,16 +21,15 @@ class CodeBlock extends HTMLElement{ } determineAndLoadContent(){ - const src = this.src; - if(!src){ - return - } - CodeBlock.getSource(src) + CodeBlock.getSource(this.src) .then( (data) => this.consumeData(data,CodeBlock.InsertMode.Replace), - (e) => this.consumeData({content:this.textContent},CodeBlock.InsertMode.Replace) + (e) => { + if(this.textContent.length){ + this.consumeData({content:this.textContent},CodeBlock.InsertMode.Replace); + } + } ); - } get name(){