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

Update to next reveal release for self-contained and background-image to work #137

Open
cderv opened this issue Sep 28, 2021 · 2 comments
Open
Labels
bug an unexpected problem or unintended behavior reveal.js upstream lib

Comments

@cderv
Copy link
Collaborator

cderv commented Sep 28, 2021

This is something at the pandoc / reveal level

curl --output background.jpg -L 'https://unsplash.com/photos/8OyKWQgBsKQ/download?force=true&w=1920'

echo "# Slide {data-background-image='background.jpg'}" > slide.md
echo "" >> slide.md
echo "Content" >> slide.md

# Not self contained 
pandoc -t revealjs -s -o slide.html --metadata title="test" slide.md

# Self contained
pandoc -t revealjs --self-contained -o slide-self-contained.html --metadata title="test" slide.md

data-uri are not loaded. I believe mainly because the content of data-background-url is passed to url() in the slide section by reveal

Source is

data-background-image="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/

But after reveal.js process, it gets wrongly split into two url() call

<div class="slide-background-content" style="background-image: url(&quot;data:image/jpeg;base64&quot;), url(&quot;/9j/4AAQSkZJRgABAQEASABIAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/

Should be as with reveal.js 3

<div class="slide-background-content" style="background-image: url(&quot;data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4gIcSUNDX1BST0ZJTEUAAQEAAAIMbGNtcwIQAABtbnRyUkdCIFhZWiAH3AABABkAAwApADlhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAApkZXNjAAAA/

Issue opened on Pandoc discuss to have thoughts from Pandoc teams :
https://groups.google.com/g/pandoc-discuss/c/LcbGvVRDoSw

@cderv
Copy link
Collaborator Author

cderv commented Sep 28, 2021

Found the related issue: hakimel/reveal.js#2978

This is a regression from 4.1.1 when support for multiple background image was added

I'll comment there.

@cderv
Copy link
Collaborator Author

cderv commented Sep 28, 2021

This is now fixed in dev version of revealjs hakimel/reveal.js@05e57de

Hoepfully, we'll get a release soon to include

@cderv cderv changed the title Self-contained and background-image does not work with revealjs 4+ Update to next reveal release for self-contained and background-image to work Sep 28, 2021
@cderv cderv added bug an unexpected problem or unintended behavior reveal.js upstream lib labels Sep 28, 2021
@cderv cderv mentioned this issue Oct 6, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior reveal.js upstream lib
Projects
None yet
Development

No branches or pull requests

2 participants
@cderv and others