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
Unveilhooks tries to load page in data-link as css #750
Comments
I'm working on Autoptimize 2.7, in which I am going to fix this with a small workaround by excluding tmp = target.getAttribute('data-link');
if(tmp){
addStyleScript(tmp, true);
} into tmp = target.getAttribute('data-link');
if(tmp && target.tagName.toLowerCase != 'img'){
addStyleScript(tmp, true);
} |
@futtta Maybe as a workaround I could introduce a variable |
a variable by which to exclude? that would indeed work I guess. |
Describe the bug
The WordPress core "gallery" block adds a data-link attribute to images with the link to the attachment page which lazysizes+unveilhooks tries to load assuming it is CSS.
To Reproduce
Example HTML as generated by WordPress Gallery block is at https://gist.github.com/futtta/ee0f5eeedbdba0d884ac1376def3d6f6
Steps to reproduce the behavior:
What is the expected behavior
Attachment page is not loaded.
What happened instead
Attachment page is loaded.
In what environment (browser/device etc.) does this bug happen/not happen:
Happens in all if lazysizes+unveilhooks is active.
The text was updated successfully, but these errors were encountered: