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

Parenthesis in rss urls being escaped #219

Open
Taffaz opened this issue Sep 14, 2024 · 2 comments
Open

Parenthesis in rss urls being escaped #219

Taffaz opened this issue Sep 14, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@Taffaz
Copy link

Taffaz commented Sep 14, 2024

A rather niche issue that is affecting me. I've created an API that converts the output from https://boardgamegeek.com/xmlapi2/hot?boardgame into an RSS feed that can be read using the RSS widget. However, if you look in the link the urls have parenthesis in them which get escaped. When I look at my glance homepage the image urls have %28%29 in place of ().

Is this something I can fix with a setting?

I'm fairly sure it's not an issue on my end as all my debugging indicates the () are being sent correctly and the escaping to %28%29 is happening on the glance server.

@svilenmarkov
Copy link
Member

svilenmarkov commented Sep 16, 2024

Unfortunately there is no setting to prevent this behavior. Go's html/template automatically escapes parentheses regardless of the type of the value, be it template.HTML, template.URL or template.HTMLAttr. There is an issue regarding this over at Go's repository (golang/go#63586 (comment)) and I think I agree with rsc, it's up to the server to decode those characters properly.

The only way I can think of to overcome this from within Glance is to extract the entire <img> tag into a template.HTML and pass that to the template which should avoid the escaping, though it's kinda hacky and would require me to rewrite a bunch of stuff because images have different classes depending on the style of the widget. Happy to hear any other ideas if someone has a simpler solution.

Upon further research, this appears to be an old issue with thumbor, which is what boardgamegeek.com is using to serve its thumbnails.

@svilenmarkov svilenmarkov added the help wanted Extra attention is needed label Sep 16, 2024
@Taffaz
Copy link
Author

Taffaz commented Sep 18, 2024

Thanks for looking into it and providing more information. As a result I've redesigned to use the extension module to provide the html directly rather than relying on the RSS module and that works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants