diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/EditorFactory.js | 2 | ||||
-rw-r--r-- | src/tests/markdown.spec.js | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/EditorFactory.js b/src/EditorFactory.js index 7f9502b46..e7dda9e79 100644 --- a/src/EditorFactory.js +++ b/src/EditorFactory.js @@ -127,7 +127,7 @@ const createMarkdownSerializer = (_nodes, _marks) => { { ...defaultMarkdownSerializer.marks, ...marks } ), serialize: function(content, options) { - return this.serializer.serialize(content, options).split('\\[ \\]').join('[ ]') + return this.serializer.serialize(content, { ...options, tightLists: true }).split('\\[ \\]').join('[ ]') .split('\\[x\\]').join('[x]') } } diff --git a/src/tests/markdown.spec.js b/src/tests/markdown.spec.js index 83ed81c5d..2c69aa9d3 100644 --- a/src/tests/markdown.spec.js +++ b/src/tests/markdown.spec.js @@ -59,12 +59,12 @@ describe('Markdown though editor', () => { expect(markdownThroughEditor('~~Test~~')).toBe('~~Test~~') }) test('ul', () => { - expect(markdownThroughEditor('- foo\n- bar')).toBe('* foo\n\n* bar') - expect(markdownThroughEditor('- foo\n\n- bar')).toBe('* foo\n\n* bar') - expect(markdownThroughEditor('- foo\n\n\n- bar')).toBe('* foo\n\n* bar') + expect(markdownThroughEditor('- foo\n- bar')).toBe('* foo\n* bar') + expect(markdownThroughEditor('- foo\n\n- bar')).toBe('* foo\n* bar') + expect(markdownThroughEditor('- foo\n\n\n- bar')).toBe('* foo\n* bar') }) test('ol', () => { - expect(markdownThroughEditor('1. foo\n2. bar')).toBe('1. foo\n\n2. bar') + expect(markdownThroughEditor('1. foo\n2. bar')).toBe('1. foo\n2. bar') }) test('paragraph', () => { expect(markdownThroughEditor('foo\nbar\n\nfoobar\n\tfoobar')).toBe('foo bar\n\nfoobar foobar') |