Skip to content

Commit

Permalink
Merge pull request Evansy#7 from wangwei2018613/fix-neper-20230531
Browse files Browse the repository at this point in the history
  • Loading branch information
Evansy authored May 31, 2023
2 parents 7bbd747 + ceba79f commit 5b252c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/RenderMsg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export default defineComponent({
for (const [url, title] of Object.entries(props.urlMap)) {
result = result?.replace(
url,
`<a rel="noopener noreferrer nofollow" target="_blank" class="msg-content-link" style="color: var(${
props.isMe ? '#fff' : '--color-primary'
});" href="${url.includes('http') ? url : `//${url}`}">${title}</a>`,
`<a rel="noopener noreferrer nofollow" target="_blank" class="msg-content-link" style="color: ${
props.isMe ? '#fff' : 'var(--color-primary)'
};" href="${url.includes('http') ? url : `//${url}`}">${title}</a>`,
)
}
const clean = DOMPurify.sanitize(result, { ALLOWED_TAGS: ['a'], ALLOWED_ATTR: ['style', 'href', 'rel', 'class'] })
Expand Down

0 comments on commit 5b252c4

Please sign in to comment.