preserve spaces between inline elements

This commit is contained in:
David Chester 2019-05-14 13:15:15 +00:00 committed by SyntaxRules
parent 33f2f9cf52
commit 525b65f6d6
3 changed files with 3 additions and 1 deletions

View File

@ -393,7 +393,7 @@ showdown.Converter = function (converterOptions) {
for (var n = 0; n < node.childNodes.length; ++n) {
var child = node.childNodes[n];
if (child.nodeType === 3) {
if (!/\S/.test(child.nodeValue)) {
if (!/\S/.test(child.nodeValue) && !/^[ ]+$/.test(child.nodeValue)) {
node.removeChild(child);
--n;
} else {

View File

@ -0,0 +1 @@
<p><em>one</em> <em>two</em> <em>three</em></p>

View File

@ -0,0 +1 @@
*one* *two* *three*