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

Escape URIs in links #49

Closed
tdemin opened this issue Nov 29, 2021 · 0 comments · Fixed by #51
Closed

Escape URIs in links #49

tdemin opened this issue Nov 29, 2021 · 0 comments · Fixed by #51
Labels
bug Something isn't working renderer Issue related to the Gemtext renderer
Milestone

Comments

@tdemin
Copy link
Owner

tdemin commented Nov 29, 2021

In Gemtext, the URI and the alt text are separated with a space, meaning links containing spaces will be broken after render. Minimal reproduction sample:

[I am a link with spaces](content/filename with spaces.gmi).

A single pass of net/uri.PathEscape() should be enough.

@tdemin tdemin added bug Something isn't working renderer Issue related to the Gemtext renderer labels Nov 29, 2021
@tdemin tdemin added this to the 0.5.0 milestone Nov 29, 2021
tdemin added a commit that referenced this issue Dec 25, 2021
This makes gmnhg encode link destinations before rendering them into
Gemtext according to #3986. This fixes spaces in links in particular.

Fixes #49.
tdemin added a commit that referenced this issue Dec 25, 2021
This makes gmnhg encode link destinations before rendering them into
Gemtext according to RFC 3986. This particularly fixes spaces in links.

Fixes #49.
tdemin added a commit that referenced this issue Jan 13, 2022
This makes gmnhg encode link destinations before rendering them into
Gemtext according to RFC 3986. This particularly fixes spaces in links.

Invalid URIs will skipped from rendering entirely.

Fixes #49.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working renderer Issue related to the Gemtext renderer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant