lemmy
lemmy copied to clipboard
Code block containing URL gets corrupted
Requirements
- [x] This is a bug report, and if not, please post to https://lemmy.ml/c/lemmy_support instead.
- [x] Please check to see if this issue already exists.
- [x] It's a single bug. Do not report multiple bugs in one issue.
- [x] It's a frontend issue, not a backend issue; Otherwise please create an issue on the backend repo instead.
Summary
Submitting a post or comment on Lemmy with the following :
```javascript
const url = `https://example.com?foo=${bar}`
```
Gets turned into the following :
```javascript
const url = `https://example.com/?foo=%24%7Bbar%7D`
```
Diff :
Steps to Reproduce
- Write this code block as a post or comment ;
- Submit ;
- Notice difference.
Technical Details
Not relevant
Lemmy Instance Version
0.19.12
Lemmy Instance URL
https://jlai.lu/comment/15092350
Confirmed
This problem is caused by the url cleaner added in https://github.com/LemmyNet/lemmy/pull/5018. It needs to ignore text inside of code blocks, probably by converting it to a markdown-it plugin and working similar to markdown_rewrite_image_links().