We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From Petr Dlouhý in #195 I have similar problem with Django templates:
- <img - {% if value.image.file.url|split:"."|last|lower == "gif" %} - src="{{value.image.file.url}}" - {% else %} - {% image value.image fill-640x360 as block_image_640 %} - {% image value.image fill-768x432 as block_image_768 %} - {% image value.image fill-1024x576 as block_image_1024 %} - {% image value.image fill-1600x900 as block_image_1600 %} - data-src="{{ block_image_640.url }}" - data-srcset=" - {{ block_image_640.url }} 640w, - {{ block_image_768.url }} 768w, - {{ block_image_1024.url }} 1024w, - {{ block_image_1600.url }} 1600w - " - sizes="(min-width: 1200px) 458px, (min-width: 992px) 374px, (min-width: 768px) 720px, calc(100vw - 30px)" - {% endif %} - class="richtext-image imageblock overflow {{ value.image_position }} lazy" - title="{{ value.image.title }}" - alt="Block image" - /> + <img {% if value.image.file.url|split:"."|last|lower == "gif" %} src="{{ value.image.file.url }}" {% else %} {% image value.image fill-640x360 as block_image_640 %} {% image value.image fill-768x432 as block_image_768 %} {% image value.image fill-1024x576 as block_image_1024 %} {% image value.image fill-1600x900 as block_image_1600 %} data-src="{{ block_image_640.url }}" data-srcset=" {{ block_image_640.url }} 640w, {{ block_image_768.url }} 768w, {{ block_image_1024.url }} 1024w, {{ block_image_1600.url }} 1600w " sizes="(min-width: 1200px) 458px, (min-width: 992px) 374px, (min-width: 768px) 720px, calc(100vw - 30px)" {% endif %} + class="richtext-image imageblock overflow {{ value.image_position }} lazy" + title="{{ value.image.title }}" + alt="Block image"/>
I am not sure why it does that, while on most other places it splits the long lines rather nicely.
source html
<img {% if value.image.file.url|split:"."|last|lower == "gif" %} src="{{value.image.file.url}}" {% else %} {% image value.image fill-640x360 as block_image_640 %} {% image value.image fill-768x432 as block_image_768 %} {% image value.image fill-1024x576 as block_image_1024 %} {% image value.image fill-1600x900 as block_image_1600 %} data-src="{{ block_image_640.url }}" data-srcset=" {{ block_image_640.url }} 640w, {{ block_image_768.url }} 768w, {{ block_image_1024.url }} 1024w, {{ block_image_1600.url }} 1600w " sizes="(min-width: 1200px) 458px, (min-width: 992px) 374px, (min-width: 768px) 720px, calc(100vw - 30px)" {% endif %} class="richtext-image imageblock overflow {{ value.image_position }} lazy" title="{{ value.image.title }}" alt="Block image" />
The text was updated successfully, but these errors were encountered:
Changes to make the formatting work:
image
srcset
data-srcset
sizes
(I removed the if statement for now and will handle that in #443 )
The output will be
<img {% image value.image fill-640x360 as block_image_640 %} {% image value.image fill-768x432 as block_image_768 %} {% image value.image fill-1024x576 as block_image_1024 %} {% image value.image fill-1600x900 as block_image_1600 %} data-src="{{ block_image_640.url }}" data-srcset="{{ block_image_640.url }} 640w, {{ block_image_768.url }} 768w, {{ block_image_1024.url }} 1024w, {{ block_image_1600.url }} 1600w" sizes="(min-width: 1200px) 458px, (min-width: 992px) 374px, (min-width: 768px) 720px, calc(100vw - 30px)" class="richtext-image imageblock overflow {{ value.image_position }} lazy" title="{{ value.image.title }}" alt="Block image"/>
Sorry, something went wrong.
0d170aa
chore(release): 1.19.4 [skip ci]
64486dc
## [1.19.4](v1.19.3...v1.19.4) (2022-11-03) ### Bug Fixes * **attributes:** fixed poor django attribute parsing ([bd90f08](bd90f08)), closes [#427](#427) [#438](#438) * **attributes:** prevented attribute indentation for url type attributes ([907a1bf](907a1bf)), closes [#320](#320) [#86](#86) [#195](#195) * **image tag:** added image tag to template break tag list. srcset formatting ([0d170aa](0d170aa)), closes [#444](#444)
🎉 This issue has been resolved in version 1.19.4 🎉
The release is available on:
Your semantic-release bot 📦🚀
No branches or pull requests
From Petr Dlouhý in #195
I have similar problem with Django templates:
I am not sure why it does that, while on most other places it splits the long lines rather nicely.
source html
The text was updated successfully, but these errors were encountered: