use marked instead of commonmark to convert MD to HTML, which supports e.g. tables, closes #2026

This commit is contained in:
zadam
2023-07-15 10:31:50 +02:00
parent 27e6fa9526
commit 64b86b2666
12 changed files with 91 additions and 110 deletions

View File

@@ -1,4 +1,5 @@
const becca = require("../../becca/becca");
const markdownService = require("../../services/import/markdown");
function getIconUsage() {
const iconClassToCountMap = {};
@@ -24,6 +25,15 @@ function getIconUsage() {
return { iconClassToCountMap };
}
function renderMarkdown(req) {
const { markdownContent } = req.body;
return {
htmlContent: markdownService.renderToHtml(markdownContent, '')
};
}
module.exports = {
getIconUsage
getIconUsage,
renderMarkdown
};