You've already forked AstralRinth
forked from didirus/AstralRinth
Fix duplicate version nums + etc (#831)
* Fix duplicate version nums + etc * Update link info * Remove useless loading conditions * Update pages/legal/privacy.vue Co-authored-by: triphora <emmaffle@modrinth.com> * Update plugins/xss.js Co-authored-by: triphora <emmaffle@modrinth.com> Co-authored-by: triphora <emmaffle@modrinth.com>
This commit is contained in:
23
plugins/markdown.js
Normal file
23
plugins/markdown.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import MarkdownIt from 'markdown-it'
|
||||
|
||||
export default (ctx, inject) => {
|
||||
const md = new MarkdownIt('default', {
|
||||
html: true,
|
||||
linkify: true,
|
||||
breaks: false,
|
||||
})
|
||||
|
||||
const defaultRender =
|
||||
md.renderer.rules.link_open ||
|
||||
function (tokens, idx, options, env, self) {
|
||||
return self.renderToken(tokens, idx, options)
|
||||
}
|
||||
|
||||
md.renderer.rules.link_open = function (tokens, idx, options, env, self) {
|
||||
tokens[idx].attrJoin('rel', 'noopener noreferrer ugc')
|
||||
|
||||
return defaultRender(tokens, idx, options, env, self)
|
||||
}
|
||||
|
||||
inject('md', md)
|
||||
}
|
||||
Reference in New Issue
Block a user