我在寻找 markdown 的 js 渲染, markdown 是支持部分 html 标签的,比如 <table> <pre>,找了一些 js 渲染的 lib,比如
https://github.com/chjj/marked ,但是普遍存在一个问题,如果设置 sanitize: true, 就是安全渲染,那么所有的 html 标签都会被生成原来的代码,如果不安全渲染,那么类似
<script src="https://gitshell.com/static/js/app/marked/marked.js"></script>
的 js 代码也能注入,这个问题很头疼。
问题:有没有一个 markdown js lib,能渲染基本 html 标签,又避免 xss 的攻击?过滤掉有害的注入。