mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
use marked instead of commonmark to convert MD to HTML, which supports e.g. tables, closes #2026
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user