From 938934f5e9beffa722c2be9ce5792ae960b35f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 16 May 2018 17:40:45 +0200 Subject: [PATCH] FIX: keep '' formatting when quoting posts --- app/assets/javascripts/discourse/lib/to-markdown.js.es6 | 2 +- test/javascripts/lib/to-markdown-test.js.es6 | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/to-markdown.js.es6 b/app/assets/javascripts/discourse/lib/to-markdown.js.es6 index 6fb56e4db8f..fa8259b7df4 100644 --- a/app/assets/javascripts/discourse/lib/to-markdown.js.es6 +++ b/app/assets/javascripts/discourse/lib/to-markdown.js.es6 @@ -359,7 +359,7 @@ const tags = [ ...Tag.emphases().map((e) => Tag.emphasis(e[0], e[1])), Tag.cell("td"), Tag.cell("th"), Tag.replace("br", "\n"), Tag.replace("hr", "\n---\n"), Tag.replace("head", ""), - Tag.keep("ins"), Tag.keep("del"), Tag.keep("small"), Tag.keep("big"), + Tag.keep("ins"), Tag.keep("del"), Tag.keep("small"), Tag.keep("big"), Tag.keep("kbd"), Tag.li(), Tag.link(), Tag.image(), Tag.code(), Tag.blockquote(), Tag.table(), Tag.tr(), Tag.ol(), Tag.list("ul"), ]; diff --git a/test/javascripts/lib/to-markdown-test.js.es6 b/test/javascripts/lib/to-markdown-test.js.es6 index d310d97f20a..6336da48ad1 100644 --- a/test/javascripts/lib/to-markdown-test.js.es6 +++ b/test/javascripts/lib/to-markdown-test.js.es6 @@ -181,6 +181,9 @@ QUnit.test("supporting html tags by keeping them", assert => { html = `Lorem ipsum dolor sit.`; assert.equal(toMarkdown(html), html); + html = `Have you tried clicking the Help Me! button?`; + assert.equal(toMarkdown(html), html); + html = `Lorem ipsum \n\n\n dolor sit.`; output = `Lorem [ipsum dolor sit.](http://example.com)`; assert.equal(toMarkdown(html), output);