diff --git a/themes/grav/js/htmleditor.js b/themes/grav/js/htmleditor.js
index ad633c0c..a6b65ebb 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(/^---([\s\S]*?)---\n{1,}/gm, '');
+ this.currentvalue = this.editor.getValue().replace(/^---([\s\S]*?)---\n{1,}/g, '');
// empty code
if (!this.currentvalue) {