From 02229fc90cf4ede50bf2d6527cb078ab1c75aa9d Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Thu, 18 Sep 2014 17:40:41 -0700 Subject: [PATCH] Remove YAML headers from preview with smart new-line detection --- themes/grav/js/htmleditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/grav/js/htmleditor.js b/themes/grav/js/htmleditor.js index 33d3de4d..008ce626 100755 --- a/themes/grav/js/htmleditor.js +++ b/themes/grav/js/htmleditor.js @@ -267,7 +267,7 @@ render: function() { - this.currentvalue = this.editor.getValue(); + this.currentvalue = this.editor.getValue().replace(/^---\n([^---]*)---\n{1,}/, ''); // empty code if (!this.currentvalue) {