Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-05-30 12:43:59 +0300
committerJulius Härtl <jus@bitgrid.net>2022-06-08 22:49:19 +0300
commit4daeb204d25163a31f53c6a5494aae4b324f7e8b (patch)
tree9424ca9f8e9cb4d332023bfbd3ae036f3d56c00d /src/tests
parent17bf216e870280dc341869c248e49f74b8c3460b (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.js10
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)')
})