Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.paste_handler_converter = function (paste_html) {
const turndownService = new TurndownService();
turndownService.addRule('headings', {
filter: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
replacement: function (content) {
return content;
},
});
turndownService.addRule('emphasis', {
filter: ['em', 'i'],
replacement: function (content) {
return '*' + content + '*';
},
});
// Checks for raw links without custom text or title.
turndownService.addRule('links', {
filter: function (node) {
return node.nodeName === "A" &&