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

Wikimedia Commons filenames with special characters in data-background-image #2831

Open
p3palazzo opened this issue Nov 3, 2020 · 5 comments

Comments

@p3palazzo
Copy link

p3palazzo commented Nov 3, 2020

The data-background-image field does not seem to like some Wikimedia Commons URLs that have special characters in them, such as this one: https://upload.wikimedia.org/wikipedia/commons/b/bd/Grand_dessein_d%E2%80%99Henri_IV_%28ch%C3%A2teau_du_Louvre%29%2C_vers_1600-1615.jpg

I tried both with the encoded strings and with non-encoded strings. This link works fine as an image URL on the slide, though. Can anyone else reproduce it, and are there any thoughts on how to work around this issue?

Reveal.js 4.1.0, tested on MacOS Firefox, Safari, and Chrome.

@ChrisLasar
Copy link

Same here with filenames containing a german umlaut (ä,ö,ü)

@p3palazzo
Copy link
Author

On a second pass, it seems I was letting some URL-encoded sequences slip through or making errors in copying the unencoded characters. Reveal.js seems to be handling the unencoded addresses just fine.

@madalu
Copy link

madalu commented Aug 9, 2021

I can confirm that this issue occurs with URL-encoded sequences in data-background-image. It does not occur if the urls are unencoded/unescaped.

@p3palazzo
Copy link
Author

I can confirm that this issue occurs with URL-encoded sequences in data-background-image. It does not occur if the urls are unencoded/unescaped.

Indeed, but I still have trouble with URLs/filenames that contain commas , — for some reason the URL is truncated at the comma, even if it is unencoded.

@hakimel
Copy link
Owner

hakimel commented Aug 24, 2021

I can reproduce the issue with the Wikimedia URL you included but haven't found a way to fix it yet. We run encodeURI for all background images here: https://github.com/hakimel/reveal.js/blob/master/js/controllers/slidecontent.js#L106. I tried decoding the URL before encoding it but wasn't able to find a way to get it to work.

Commas are used to delimit multiple background images so they won't work in URLs. Support for multiple backgrounds was merged recently in #2940.

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

4 participants