nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.13k stars 628 forks source link

A Link in Markdown automatically has a rel="nofollow noopener noreferrer" #2138

Open Mitchellkohler opened 1 year ago

Mitchellkohler commented 1 year ago

Environment


Reproduction

n.a.

Describe the bug

A Link in Markdown automatically has a rel="nofollow noopener noreferrer". However I expect that all links are "follow links" and only are "nofollow noopener noreferrer links" when I state this in the markdown.

Used markdown: [Link Text](https://yourwebsite.com/)

Additional context

No response

Logs

No response

Barbapapazes commented 1 year ago

You can update the ProseA component if you want to update behavior!

nobkd commented 1 year ago

The first paragraph describes how you override content components

Here is the source of ProseA

<NuxtLink> defaults to "noopener noreferrer" for external links

manniL commented 1 year ago

I think this behavior should be changed to not alter rel by default - people could easily customize it via ProseA.

manniL commented 1 year ago

Okay, apparently this comes from the 'rehype-external-links' plugin which is enabled by default. It can be disabled via config:

content: {
    markdown: {
      rehypePlugins: {
        'rehype-external-links': false,
      }
    },
},
JiProchazka commented 4 months ago

Okay, apparently this comes from the 'rehype-external-links' plugin which is enabled by default. It can be disabled via config:

content: {
    markdown: {
      rehypePlugins: {
        'rehype-external-links': false,
      }
    },
},

Is it still working? It is not for me.

This worked for me:

 mdc: {
    // removing rel="nofollow" from links
    rehypePlugins: {
      "rehype-external-links": {
        options: {
          rel: ["external"]
        }
      }
    },
}