From c0af5aeb71b80067d5e89edb7bd7b33995bf47bd Mon Sep 17 00:00:00 2001 From: Le Tan Date: Wed, 17 Oct 2018 20:02:01 +0800 Subject: [PATCH] Turndown: delete redundant spaces after list item --- src/utils/turndown/turndown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/turndown/turndown.js b/src/utils/turndown/turndown.js index 716ff225..9d8c9753 100644 --- a/src/utils/turndown/turndown.js +++ b/src/utils/turndown/turndown.js @@ -108,12 +108,12 @@ rules.listItem = { .replace(/^\n+/, '') // remove leading newlines .replace(/\n+$/, '\n') // replace trailing newlines with just a single one .replace(/\n/gm, '\n '); // indent - var prefix = options.bulletListMarker + ' '; + var prefix = options.bulletListMarker + ' '; var parent = node.parentNode; if (parent.nodeName === 'OL') { var start = parent.getAttribute('start'); var index = Array.prototype.indexOf.call(parent.children, node); - prefix = (start ? Number(start) + index : index + 1) + '. '; + prefix = (start ? Number(start) + index : index + 1) + '. '; } return ( prefix + content + (node.nextSibling && !/\n$/.test(content) ? '\n' : '')