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:
@@ -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(/>>([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)
|
||||
};
|
||||
|
Reference in New Issue
Block a user