content icon indicating copy to clipboard operation
content copied to clipboard

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

Open Mitchellkohler opened this issue 2 years ago • 5 comments

Environment


  • Operating System: Darwin
  • Node Version: v14.15.0
  • Nuxt Version: 2.15.8
  • Nitro Version: -
  • Package Manager: [email protected]
  • Builder: webpack
  • User Config: target, generate, head, css, plugins, components, buildModules, modules, cookies, content, build, sitemap, publicRuntimeConfig
  • Runtime Modules: @nuxt/[email protected], ~/modules/nuxt-cookie-control-master, @nuxtjs/[email protected]
  • Build Modules: -

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

Mitchellkohler avatar Jul 04 '23 15:07 Mitchellkohler

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

Barbapapazes avatar Jul 05 '23 13:07 Barbapapazes

The first paragraph describes how you override content components

~~Here is the source of ProseA~~

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

nobkd avatar Jul 05 '23 14:07 nobkd

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

TheAlexLichter avatar Sep 09 '23 10:09 TheAlexLichter

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,
      }
    },
},

TheAlexLichter avatar Sep 09 '23 10:09 TheAlexLichter

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"]
        }
      }
    },
}

JiProchazka avatar Jun 25 '24 21:06 JiProchazka

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Dec 10 '24 15:12 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Jan 09 '25 16:01 github-actions[bot]