Fixed issue relating to showdownjs not escaping html tags by porting to

markdown-it, also introduced a new function: func.render_md
This commit is contained in:
2025-08-27 15:09:57 +01:00
parent 5f07db1e15
commit 9b5d3f3f73
8 changed files with 17 additions and 31 deletions

View File

@@ -86,6 +86,7 @@ export function escape_input(input) {
.replaceAll("'", "'")
.replaceAll("/", "/")
.replaceAll("%", "%")
.replaceAll("&", "&")
return output
}
@@ -98,3 +99,8 @@ export function render_comment(comment_content) {
.replaceAll(/&gt;&gt;([0-9]*)/g, "<a href='/comment/$1'>>>$1</a>")
.replaceAll("\n", "<br/>")
};
export function render_md(content) {
const markdownit = require("markdown-it")
const md = markdownit()
return md.render(content)
};