Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autolink bug #12

Closed
chenxsan opened this issue Apr 5, 2021 · 1 comment
Closed

Autolink bug #12

chenxsan opened this issue Apr 5, 2021 · 1 comment
Labels
👀 no/external This makes more sense somewhere else

Comments

@chenxsan
Copy link

chenxsan commented Apr 5, 2021

Subject of the issue

Here's the markdown text:

Please use relative URLs (/concepts/mode/) to link our own content instead of absolute URLs (https://webpack.js.org/concepts/mode/).

It renders into:

<p>Please use relative URLs (/concepts/mode/) to link our own content instead of absolute URLs (<a href="https://webpack.js.org/concepts/mode/)">https://webpack.js.org/concepts/mode/)</a>.</p>

As you can see, there's a superfluous ) at the end of href of the a element.

Steps to reproduce

Here's the code to run:

var vfile = require('to-vfile')
var report = require('vfile-reporter')
var unified = require('unified')
var parse = require('remark-parse')
var gfm = require('remark-gfm')
var remark2rehype = require('remark-rehype')
var stringify = require('rehype-stringify')

unified()
  .use(parse)
  .use(gfm)
  .use(remark2rehype)
  .use(stringify)
  .process(`Please use relative URLs (/concepts/mode/) to link our own content instead of absolute URLs (https://webpack.js.org/concepts/mode/).`, function (err, file) {
    console.error(report(err || file))
    console.log(String(file))
  })

Expected behavior

No superfluous ) at the end of href.

Actual behavior

Superfluous ) included in href.

PS

You can see how github renders the markdown below:

Please use relative URLs (/concepts/mode/) to link our own content instead of absolute URLs (https://webpack.js.org/concepts/mode/).

@wooorm
Copy link
Member

wooorm commented Apr 5, 2021

Nice catch!

@wooorm wooorm added 👀 no/external This makes more sense somewhere else and removed 🐛 type/bug This is a problem 🙉 open/needs-info This needs some more info labels Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 no/external This makes more sense somewhere else
Development

No branches or pull requests

2 participants