From d90c387875f9e7f037e84742fc43d6ec31320070 Mon Sep 17 00:00:00 2001 From: Aetf Date: Mon, 12 Apr 2021 22:56:10 -0400 Subject: [PATCH] Add tests for html entities encoding --- tests/without-config.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/without-config.js b/tests/without-config.js index 52a77a1..a6805c9 100644 --- a/tests/without-config.js +++ b/tests/without-config.js @@ -47,6 +47,19 @@ let posts = [

block 2 123

block3
`.trim() + }, + { + path: '', + title: 'post with html entities', + excerpt: '', + layout: '', + content: ` +

block 1 <span>

+

2

3

4

+

5

6

7

+

8

9

10

+

block 11 <span>

+`.trim() } ]; @@ -73,4 +86,9 @@ describe('Automatic excerpt generator with default depth config', () => { generatedPosts[2].data.excerpt.should.equal(''); }); + it('post with html entities should have them intact', () => { + generatedPosts[3].data.excerpt.should.equal('

block 1 <span>

\n

2

3

4

\n

5

6

7

\n

8

9

10

'); + generatedPosts[3].data.more.should.equal('\n

block 11 <span>

'); + }); + });