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

Rendering code replaces @xyz with github link in URLs, breaking link targets #204

Open
joshtriplett opened this issue Dec 19, 2024 · 2 comments

Comments

@joshtriplett
Copy link
Member

If you write something like [this document](https://hackmd.org/@xyz/document), the rendering code will replace @xyz with a github link, breaking the URL in the hackmd link.

This replacement needs to be markdown-aware, and shouldn't happen in (at least) code blocks and link targets. If that's not easily possible, then we should disable the username-replacement logic until it can be fixed.

#203 was a PR that resulted from having to work around this breakage.

@nikomatsakis
Copy link
Contributor

Yeah, it's currently just some simple regexs. It might be worth breaking out a real markdown parser.

@nikomatsakis
Copy link
Contributor

It seems like comrak can be easily made to do what is needed...

https://github.com/kivikakk/comrak?tab=readme-ov-file#usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants