`gatsby-plugin-mdx`: `remark-external-links` generates invalid `rel`
See original GitHub issueDescription
Using remark-external-links
with gatsby-plugin-mdx
generates an invalid rel
attribute: nofollow,noopener,noreferrer
instead of nofollow noopener noreferrer
, how it is supposed to be.
Usage with gatsby-plugin-mdx
and remarkPlugins
Usage alone
Steps to reproduce
Add the following code to Runkit (you can use this link: https://npm.runkit.com/remark-external-links). This generates the correct rel
.
var remark = require('remark')
var externalLinks = require("remark-external-links")
var html = require('remark-html')
var input = '[remark](https://github.com/remarkjs/remark)'
remark().use(externalLinks).use(html).processSync(input).toString()
Try out my gatsby-plugin-mdx
sandbox at the link below. This generates an invalid rel
:
gatsby-plugin-mdx
Sandbox: https://codesandbox.io/s/empty-cdn-u31qb
Expected result
The correct rel
should be generated.
Actual result
An invalid rel
is generated.
Environment
System:
OS: Linux 4.19 Debian GNU/Linux 10 (buster) 10 (buster)
CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Shell: 5.0.3 - /bin/bash
Binaries:
Node: 10.18.1 - /tmp/yarn--1585757330032-0.1053501887919337/node
Yarn: 1.21.1 - /tmp/yarn--1585757330032-0.1053501887919337/yarn
npm: 6.13.4 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
npmPackages:
gatsby: 2.20.9 => 2.20.9
gatsby-plugin-mdx: ^1.0.23 => 1.0.23
Issue Analytics
- State:
- Created 3 years ago
- Comments:29 (17 by maintainers)
Top Results From Across the Web
gatsby-remark-external-links
Adds the target and rel attributes to external links in markdown. This is a gatsby port of the remark-external-links remark plugin.
Read more >Rewriting my blog with Next.js - Dimitrios Lytras
Replacing Gatsby's Markdown plugins, and introducing MDX. Here's the juicy part. I wanted to create some custom components in my markdown files.
Read more >npm - Cannot add plugins on gatsby - Stack Overflow
I have a dependency error trying to add any of the plugins available for gatsby. This issue is there immediately after the first ......
Read more >gatsby-remark-code-repls - npm package - Snyk
Gatsby plugin to auto-generate links to popular REPLs like Babel and Codepen For more information about how to use this package see README...
Read more >Migrating this Blog to Next.js from Gatsby
And I couldn't find external links to day archives on my blog, ... Gatsby's Markdown and MDX plugins use Remark, which in turn...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, agree it’s unfortunate.
Wonder if the Gatsby team would be open to changing this for Remark plugins (the wrapper bit can also be absorbed into
gatsby-transformer-remark
, I guess?).Ah it looks like publishing additional “wrapper” npm packages to wrap every remark plugin is the recommended way of doing things 😞 At least in 2018 it was like this.
References:
So @wooorm I guess the process of writing extra wrapper packages you described the downsides about in https://github.com/gatsbyjs/gatsby/issues/22719#issuecomment-622305670 is actually recommended 😞