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
diff options
context:
space:
mode:
authorFerdinand Thiessen <rpm@fthiessen.de>2022-10-03 19:16:28 +0300
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2022-10-03 21:07:04 +0300
commite82a97a54e355314fa49e050811eb91d61d81d1d (patch)
tree913ff5d6990c49df66ef909cecac8f11937f6375 /src
parent115800ee5f7a502450a7d8102f43da30aebd3d71 (diff)
Added a unittest for escaping of table cells
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
Diffstat (limited to 'src')
-rw-r--r--src/tests/markdown.spec.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tests/markdown.spec.js b/src/tests/markdown.spec.js
index 2ae3cb4be..f71dde3b0 100644
--- a/src/tests/markdown.spec.js
+++ b/src/tests/markdown.spec.js
@@ -193,6 +193,11 @@ describe('Markdown serializer from html', () => {
)).toBe(`::: warn\n!warning!\n\n:::`)
})
+ test('table cell escaping', () => {
+ // while '|' has no special meaning in commonmark is has to be escaped for GFM tables
+ expect(markdownThroughEditorHtml('<table><tr><th>greetings</th></tr><tr><td>hello | hallo</td></tr></table>')).toBe('| greetings |\n|-----------|\n| hello \\| hallo |\n')
+ })
+
test('front matter', () => {
expect(markdownThroughEditorHtml('<pre id="frontmatter"><code>some: value</code></pre><h1>Heading</h1>')).toBe('---\nsome: value\n---\n\n# Heading')
// Test --- within front matter is allowed