Skip to content

Commit

Permalink
chore(RichText) replace legacy dependency with 'rehype-external-links'
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Sep 8, 2023
1 parent 71c2cbd commit 836b7c8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/NcRichText/NcRichText.vue
Expand Up @@ -76,7 +76,7 @@ import markdown from 'remark-parse'
import breaks from 'remark-breaks'
import remark2rehype from 'remark-rehype'
import rehype2react from 'rehype-react'
import remarkExternalLinks from 'remark-external-links'
import rehypeExternalLinks from 'rehype-external-links'
export default {
name: 'NcRichText',
Expand Down Expand Up @@ -176,10 +176,6 @@ export default {
autolink: this.autolink,
useMarkdown: this.useMarkdown,
})
.use(remarkExternalLinks, {
target: '_blank',
rel: ['noopener noreferrer'],
})
.use(breaks)
.use(remark2rehype, {
handlers: {
Expand All @@ -190,6 +186,10 @@ export default {
})
// .use(rehypeAddClasses, this.markdownCssClasses)
.use(remarkPlaceholder)
.use(rehypeExternalLinks, {
target: '_blank',
rel: ['noopener noreferrer'],
})
.use(rehype2react, {
createElement: (tag, attrs, children) => {
if (!tag.startsWith('#')) {
Expand Down

0 comments on commit 836b7c8

Please sign in to comment.