diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-05-30 12:43:59 +0300 |
---|---|---|
committer | Max <max@nextcloud.com> | 2022-06-07 14:55:44 +0300 |
commit | efb27a52f5aed9771cb5e4a019e8a3125dfb7d59 (patch) | |
tree | bd0f4e4f629ee484113a0a8b52045ddaee26ea59 /src/tests | |
parent | 4112068233fb16770ce211d036971668b86338a7 (diff) |
Implement toMarkdown for hard break instead of replacing after markdown transformation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/markdown.spec.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tests/markdown.spec.js b/src/tests/markdown.spec.js index 2e862c13b..828bfd5c2 100644 --- a/src/tests/markdown.spec.js +++ b/src/tests/markdown.spec.js @@ -58,6 +58,11 @@ describe('Markdown though editor', () => { expect(markdownThroughEditor('#### Test')).toBe('#### Test') expect(markdownThroughEditor('##### Test')).toBe('##### Test') }) + test('hard breaks', () => { + expect(markdownThroughEditor('hard \nbreak')).toBe('hard \nbreak') + expect(markdownThroughEditor('hard\\\nbreak')).toBe('hard \nbreak') + expect(markdownThroughEditor('no\nbreak')).toBe('no break') + }) test('inline format', () => { expect(markdownThroughEditor('**Test**')).toBe('**Test**') expect(markdownThroughEditor('__Test__')).toBe('__Test__') @@ -131,6 +136,11 @@ describe('Markdown serializer from html', () => { test('paragraph', () => { expect(markdownThroughEditorHtml('<p>hello</p><p>world</p>')).toBe('hello\n\nworld') }) + test('hard line breaks', () => { + expect(markdownThroughEditorHtml('<p>hard<br />break</p>')).toBe('hard \nbreak') + expect(markdownThroughEditorHtml('<p>hard<br>break</p>')).toBe('hard \nbreak') + expect(markdownThroughEditorHtml('<p>no\nbreak</p>')).toBe('no break') + }) test('links', () => { expect(markdownThroughEditorHtml('<a href="foo">test</a>')).toBe('[test](foo)') }) |