From 6fa03e4a44f8970f5c748498522b01143bdd693f Mon Sep 17 00:00:00 2001 From: Soreine Date: Fri, 31 Aug 2018 15:06:40 +0200 Subject: [PATCH] Add failing test with nasty HRs --- examples/no-front-matter-with-hrs.md | 13 +++++++++++++ test/index.js | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 examples/no-front-matter-with-hrs.md diff --git a/examples/no-front-matter-with-hrs.md b/examples/no-front-matter-with-hrs.md new file mode 100644 index 0000000..9d3d544 --- /dev/null +++ b/examples/no-front-matter-with-hrs.md @@ -0,0 +1,13 @@ +---- + +Some markdown following a 4 dashes horizontal rule + +--- + +# Heading 1 followed by 3 _underscores_ + +___ + +--- + +Some more Markdown diff --git a/test/index.js b/test/index.js index b773125..4244af3 100644 --- a/test/index.js +++ b/test/index.js @@ -150,6 +150,19 @@ test('fm(string) - no front matter, markdown with hr', function (t) { }) }) +test('fm(string) - not a front matter, markdown with nastier hrs', function (t) { + fs.readFile( + path.resolve(__dirname, '../examples/no-front-matter-with-hrs.md'), + 'utf8', + function (err, data) { + t.error(err, 'read should not error') + + var content = fm(data) + t.equal(content.body, data) + t.end() + }) +}) + test('fm(string) - complex yaml', function (t) { fs.readFile( path.resolve(__dirname, '../examples/complex-yaml.md'),