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

Link URL getting encoded in react-markdown v9 #797

Closed
4 tasks done
ankurparihar opened this issue Nov 13, 2023 · 12 comments
Closed
4 tasks done

Link URL getting encoded in react-markdown v9 #797

ankurparihar opened this issue Nov 13, 2023 · 12 comments
Labels
💪 phase/solved Post is done

Comments

@ankurparihar
Copy link

Initial checklist

Affected packages and versions

9.0.0

Link to runnable example

No response

Steps to reproduce

Go to: https://remarkjs.github.io/react-markdown/

Open Network panel in DevTools

Paste this in readme

[![Test Badge](
https://github.com/remarkjs/react-markdown/workflows/main/badge.svg?v=123&branch=feat/router)](https://github.com/remarkjs/react-markdown/actions)

Observed URL: https://github.com/remarkjs/react-markdown/workflows/main/badge.svg?v=123&branch=feat/router

Notice: &, this is causing issues

Expected behavior

URL should not be double encoded

Actual behavior

URL is being encoded in a weird way.

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Nov 13, 2023
@wooorm
Copy link
Member

wooorm commented Nov 13, 2023

this is causing issues

It is not.

This is how HTML works.

@wooorm wooorm closed this as completed Nov 13, 2023
@wooorm wooorm added the 🤷 no/invalid This cannot be acted upon label Nov 13, 2023

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Nov 13, 2023
@ankurparihar
Copy link
Author

ankurparihar commented Nov 13, 2023

Hey @wooorm , This is causing issues due to invalid URL.

Here's a screenshot for the comparison on your own site, please have a look.

Screenshot 2023-11-13 at 2 23 25 PM

Can you please help me with a correct URL, with parameters.

@ankurparihar
Copy link
Author

Never mind, I'll recreate another example. But this is breaking!

@wooorm
Copy link
Member

wooorm commented Nov 13, 2023

It is not: there might be something else broken, likely on your end, of course. Feel free to try and reproduce the actual problem

@ankurparihar
Copy link
Author

ankurparihar commented Nov 13, 2023

Ok, finally, I'm able to reproduce!

Here you can see, in the markdown I've added a normal url from official sonarqube project

Screenshot 2023-11-13 at 3 58 10 PM

You can see what's going on in network tab, the & gets converted to & and in-turn becomes an invalid query parameter.

I'm willing to contribute a fix, but I have no idea where it's getting encoded from like this.

I appreciate the effort you guys put to create the library, please help me narrow it down.

@wooorm
Copy link
Member

wooorm commented Nov 13, 2023

Paste code so I can try it out

@wooorm wooorm reopened this Nov 13, 2023
@wooorm
Copy link
Member

wooorm commented Nov 13, 2023

Ohh, managed to reproduce!

@github-actions github-actions bot removed 👎 phase/no Post cannot or will not be acted on 🤷 no/invalid This cannot be acted upon labels Nov 13, 2023

This comment has been minimized.

@wooorm wooorm closed this as completed in d8e3787 Nov 13, 2023
@wooorm wooorm added the 💪 phase/solved Post is done label Nov 13, 2023
@ankurparihar
Copy link
Author

Sorry, I was out for a while,

Here's a snippet you can try -

[![Coverage](https://next.sonarqube.com/sonarqube/api/project_badges/measure?project=sonarqube&metric=coverage&token=d95182127dd5583f57578d769b511660601a8547)](https://next.sonarqube.com/sonarqube/dashboard?id=sonarqube)

@wooorm
Copy link
Member

wooorm commented Nov 13, 2023

Released in 9.0.1!

@ankurparihar
Copy link
Author

Awesome, thank you so much @wooorm 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 phase/solved Post is done
Development

No branches or pull requests

2 participants