Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#151
srcset="./path.png"
in ;@patrick-steele-idem
After a couple of attempts to do it and process
srcset={"2x": "./path.png"}
- i failed and fallen-back to a simpler solution.The problem i couldn't resolve was that
marko/compiler/Builder
didn't like me passing array instead of a singlesrc
here (https://github.com/lasso-js/lasso/compare/master...oxala:Lasso-img-Retina?expand=1#diff-bceb7acc917818bc45d3fb926f0dd232R55) and was crashing (with message like arg should be string, Node or null). Even though you said i need to allow arrays insidetaglib/helper-getImageInfo.js
, i think it's not the case, since it doesn't even get there, the Builder error comes before that.Solution below adds processed
srcset="./path.png
to the result image in formatsrcset="/static/.../path.png 2x"
, so >2x are at least presented with 2x image. If there is notsrcset
on the lasso-img, then of course nosrcset
presented in the output.P.S And of course if this implementation can be improved (or if it's complete rubbish) - i would love to hear it.