From bcd28865573de46a94b74471c5c609ed5d8f8e0d Mon Sep 17 00:00:00 2001 From: Yevhenii Ponomar Date: Sat, 12 Jan 2019 11:54:46 +0200 Subject: [PATCH 1/2] use opts.excerpt_separator --- lib/stringify.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/stringify.js b/lib/stringify.js index b4c70a4..359a0c6 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -35,6 +35,7 @@ module.exports = function(file, data, options) { data = Object.assign({}, file.data, data); const open = opts.delimiters[0]; const close = opts.delimiters[1]; + const sep = opts.excerpt_separator; const matter = engine.stringify(data, options).trim(); let buf = ''; @@ -44,7 +45,7 @@ module.exports = function(file, data, options) { if (typeof file.excerpt === 'string' && file.excerpt !== '') { if (str.indexOf(file.excerpt.trim()) === -1) { - buf += newline(file.excerpt) + newline(close); + buf += newline(file.excerpt) + newline(sep); } } From d8d3bb34079a0de9ab3db5a93095262a66bf8a7e Mon Sep 17 00:00:00 2001 From: Yevhenii Ponomar Date: Sat, 12 Jan 2019 13:07:07 +0200 Subject: [PATCH 2/2] fix failing 'should stringify an excerpt' test --- lib/stringify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stringify.js b/lib/stringify.js index 359a0c6..97f7b40 100644 --- a/lib/stringify.js +++ b/lib/stringify.js @@ -35,7 +35,7 @@ module.exports = function(file, data, options) { data = Object.assign({}, file.data, data); const open = opts.delimiters[0]; const close = opts.delimiters[1]; - const sep = opts.excerpt_separator; + const sep = opts.excerpt_separator || opts.delimiters[0]; const matter = engine.stringify(data, options).trim(); let buf = '';