Skip to content

Commit

Permalink
sanitize parsed html anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDiakite committed Oct 13, 2023
1 parent d063641 commit b36396b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/helpers/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export async function fetchData(type: keyof typeof setup) {
.filter(([path]) => !path.includes('template'))
.map(async ([path, resolver]) => {
const md = await resolver()
const mdHtml = md.default.render().html
let mdHtml = md.default.render().html
mdHtml = mdHtml.replace(/<a /g, "<a target='_blank' rel='external'")
return {
meta: md.metadata,
path: path,
Expand Down

0 comments on commit b36396b

Please sign in to comment.