diff --git a/themes/grav/js/htmleditor.js b/themes/grav/js/htmleditor.js
index c10cb1a0..ad633c0c 100755
--- a/themes/grav/js/htmleditor.js
+++ b/themes/grav/js/htmleditor.js
@@ -267,7 +267,7 @@
render: function() {
- this.currentvalue = this.editor.getValue().replace(/^---\n([^---]*)---\n{1,}/, '');
+ this.currentvalue = this.editor.getValue().replace(/^---([\s\S]*?)---\n{1,}/gm, '');
// empty code
if (!this.currentvalue) {