Skip to content
Snippets Groups Projects
Commit e2be956e authored by Dan Notestein's avatar Dan Notestein
Browse files

Merge branch '197-fix-responsive-images' into 'develop'

Fix responsive images bug introduced by the Lightbox implementation

Closes #197

See merge request !359
parents 045693b1 691ce0fc
No related branches found
No related tags found
2 merge requests!363Develop,!359Fix responsive images bug introduced by the Lightbox implementation
...@@ -258,18 +258,19 @@ function proxifyImages(doc, state) { ...@@ -258,18 +258,19 @@ function proxifyImages(doc, state) {
if (!linksRe.local.test(url)) { if (!linksRe.local.test(url)) {
const proxifiedImageUrl = proxifyImageUrl(url, true); const proxifiedImageUrl = proxifyImageUrl(url, true);
node.setAttribute('src', proxifiedImageUrl);
if (state.lightbox && process.env.BROWSER) { if (state.lightbox && process.env.BROWSER) {
node.parentNode.replaceChild( node.parentNode.replaceChild(
DOMParser.parseFromString(`<a href="${getDoubleSize(proxifyImageUrl(url, true))}"> DOMParser.parseFromString(`<a href="${getDoubleSize(proxifyImageUrl(url, true))}">
<img <img
src="${url}" src="${proxifiedImageUrl}"
alt="${alt}" alt="${alt}"
/> />
</a>`), </a>`),
node node
); );
} else {
node.setAttribute('src', proxifiedImageUrl);
} }
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment