diff --git a/src/translator.js b/src/translator.js index 3166474..0bdc79b 100644 --- a/src/translator.js +++ b/src/translator.js @@ -9,7 +9,6 @@ function initTurndownService() { }); turndownService.use(turndownPluginGfm.tables); - turndownService.keep(['iframe']); // preserve embedded tweets turndownService.addRule('tweet', { @@ -56,6 +55,15 @@ function initTurndownService() { } }); + // preserve
and
+ turndownService.addRule('fig', { + filter: ['figure', 'figcaption'], + replacement: (content, node) => { + const tagName = node.nodeName.toLowerCase(); + return '<' + tagName + '>' + content + ''; + } + }); + return turndownService; }