Merge pull request #3810 from phwebi/update-display-config

Update `display` config to support `!important` flag.
This commit is contained in:
Hakim El Hattab 2025-08-28 12:01:20 +02:00 committed by GitHub
commit 4cf184924d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,7 +52,13 @@ export default class SlideContent {
load( slide, options = {} ) { load( slide, options = {} ) {
// Show the slide element // Show the slide element
slide.style.display = this.Reveal.getConfig().display; const displayValue = this.Reveal.getConfig().display;
if( displayValue.includes('!important') ) {
const value = displayValue.replace(/\s*!important\s*$/, '').trim();
slide.style.setProperty('display', value, 'important');
} else {
slide.style.display = displayValue;
}
// Media elements with data-src attributes // Media elements with data-src attributes
queryAll( slide, 'img[data-src], video[data-src], audio[data-src], iframe[data-src]' ).forEach( element => { queryAll( slide, 'img[data-src], video[data-src], audio[data-src], iframe[data-src]' ).forEach( element => {