FIX: keep '<kbd>' formatting when quoting posts

This commit is contained in:
Régis Hanol 2018-05-16 17:40:45 +02:00
parent d5ae0a92ef
commit 938934f5e9
2 changed files with 4 additions and 1 deletions

View File

@ -359,7 +359,7 @@ const tags = [
...Tag.emphases().map((e) => Tag.emphasis(e[0], e[1])), ...Tag.emphases().map((e) => Tag.emphasis(e[0], e[1])),
Tag.cell("td"), Tag.cell("th"), Tag.cell("td"), Tag.cell("th"),
Tag.replace("br", "\n"), Tag.replace("hr", "\n---\n"), Tag.replace("head", ""), 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"), Tag.li(), Tag.link(), Tag.image(), Tag.code(), Tag.blockquote(), Tag.table(), Tag.tr(), Tag.ol(), Tag.list("ul"),
]; ];

View File

@ -181,6 +181,9 @@ QUnit.test("supporting html tags by keeping them", assert => {
html = `Lorem <del>ipsum dolor</del> sit.`; html = `Lorem <del>ipsum dolor</del> sit.`;
assert.equal(toMarkdown(html), html); assert.equal(toMarkdown(html), html);
html = `Have you tried clicking the <kbd>Help Me!</kbd> button?`;
assert.equal(toMarkdown(html), html);
html = `Lorem <a href="http://example.com"><del>ipsum \n\n\n dolor</del> sit.</a>`; html = `Lorem <a href="http://example.com"><del>ipsum \n\n\n dolor</del> sit.</a>`;
output = `Lorem [<del>ipsum dolor</del> sit.](http://example.com)`; output = `Lorem [<del>ipsum dolor</del> sit.](http://example.com)`;
assert.equal(toMarkdown(html), output); assert.equal(toMarkdown(html), output);