From 0eab02de9ba6aed579fc6bf194742b0bd0ab30c0 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Wed, 17 Oct 2018 20:01:28 +0800 Subject: [PATCH] Turndown: remove \n in table cell When pasting table from OneNote, there may be redundant \n that will break the table. --- src/utils/turndown/turndown-plugin-gfm.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/turndown/turndown-plugin-gfm.js b/src/utils/turndown/turndown-plugin-gfm.js index 4d66997a..32a2c948 100644 --- a/src/utils/turndown/turndown-plugin-gfm.js +++ b/src/utils/turndown/turndown-plugin-gfm.js @@ -44,6 +44,7 @@ var configs = { autoHead: false }; rules.tableCell = { filter: ['th', 'td'], replacement: function (content, node) { + content = content.replace(/[\r\n]/g, ''); return cell(content, node) } };