remarkjs/remark

Ampersand gets escaped unnecessarily in URL and breaks it.

Closed this issue · 2 comments

Initial checklist

Affected packages and versions

11.0.0

Link to runnable example

https://codesandbox.io/p/devbox/remark-with-vite-rh4w48?file=%2Fsrc%2Fmain.ts%3A19%2C6&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clvfkzjfp00053d5woza467c7%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clvfkzjfp00023d5w9e1d9d5b%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clvfkzjfp00033d5wthfixshm%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clvfkzjfp00043d5wx9j0e0wz%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clvfkzjfp00023d5w9e1d9d5b%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clvfkzjfp00013d5w27j00bt9%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252Findex.html%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%252C%257B%2522id%2522%253A%2522clvfl3zq900793d5wasxo7y3c%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A19%252C%2522startColumn%2522%253A6%252C%2522endLineNumber%2522%253A19%252C%2522endColumn%2522%253A6%257D%255D%252C%2522filepath%2522%253A%2522%252Fsrc%252Fmain.ts%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522id%2522%253A%2522clvfkzjfp00023d5w9e1d9d5b%2522%252C%2522activeTabId%2522%253A%2522clvfl3zq900793d5wasxo7y3c%2522%257D%252C%2522clvfkzjfp00043d5wx9j0e0wz%2522%253A%257B%2522id%2522%253A%2522clvfkzjfp00043d5wx9j0e0wz%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522UNASSIGNED_PORT%2522%252C%2522port%2522%253A2222%252C%2522id%2522%253A%2522clvfkzrib00333d5wldg3fcmt%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252F%2522%257D%252C%257B%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522start%2522%252C%2522port%2522%253A5173%252C%2522id%2522%253A%2522clvfl032v005g3d5wb10prccb%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clvfl032v005g3d5wb10prccb%2522%257D%252C%2522clvfkzjfp00033d5wthfixshm%2522%253A%257B%2522id%2522%253A%2522clvfkzjfp00033d5wthfixshm%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522start%2522%252C%2522id%2522%253A%2522clvfkzxbi00453d5wn1149lci%2522%252C%2522mode%2522%253A%2522permanent%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clvfkzxbi00453d5wn1149lci%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

Steps to reproduce

Transform a URL with multiple query parameters.

Expected behavior

The URL is unchanged.

Actual behavior

The URL breaks because of the added backslash.

Runtime

Node v17

Package manager

npm 8

OS

macOS

Build and bundle tools

No response

Welcome @anatolykopyl! 👋
Sorry you ran into a spot of trouble.

Could you share a sandbox with an example of the issue?
The one you shared:

  1. has no link with query params in the example markdown
  2. I suspect you are asking about backslash escapes on \& like so https://stackblitz.com/edit/github-5zebgm?file=src%2Fmain.ts

These are valid in commonmark, and does not cause an issue https://spec.commonmark.org/dingus/?text=%5Bexample%5D(https%3A%2F%2Fexample.com%3Fone%3D1%26two%3D2)%0A%0A%5Bexample%5D(https%3A%2F%2Fexample.com%3Fone%3D1%5C%26two%3D2)

If you're seeing an issue it is with another tool which cannot parse CommonMark.

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.