mirror of
https://gitlab.com/octtspacc/sitoctt
synced 2025-06-05 22:09:20 +02:00
Aggiunto Spagnolo, riconversione post Listed da HTML a Markdown
This commit is contained in:
18
Scripts/Lib/Html2Markdown.js
Normal file
18
Scripts/Lib/Html2Markdown.js
Normal file
@ -0,0 +1,18 @@
|
||||
const Exp = {};
|
||||
|
||||
const TurndownService = require('turndown');
|
||||
const turndownService = (new TurndownService({
|
||||
headingStyle: "atx",
|
||||
hr: "---",
|
||||
bulletListMarker: "*",
|
||||
codeBlockStyle: "fenced",
|
||||
fence: "```",
|
||||
emDelimiter: "_",
|
||||
strongDelimiter: "**",
|
||||
linkStyle: "inlined",
|
||||
}));
|
||||
turndownService.keep(['span', 'small', 'sup', 'sub', 'table', 'dl', 'iframe', 'video', 'audio']);
|
||||
|
||||
Exp.Transform = (html) => turndownService.turndown(html);
|
||||
|
||||
module.exports = Exp;
|
Reference in New Issue
Block a user