mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
19 lines
473 B
JavaScript
19 lines
473 B
JavaScript
"use strict";
|
|
|
|
const marked = require("marked");
|
|
const htmlSanitizer = require('../html_sanitizer');
|
|
const importUtils = require('./utils');
|
|
|
|
function renderToHtml(content, title) {
|
|
const html = marked.parse(content, {
|
|
mangle: false,
|
|
headerIds: false
|
|
});
|
|
const h1Handled = importUtils.handleH1(html, title); // h1 handling needs to come before sanitization
|
|
return htmlSanitizer.sanitize(h1Handled);
|
|
}
|
|
|
|
module.exports = {
|
|
renderToHtml
|
|
};
|