When using Craft CMS' svg function there is some slightly odd behavior, not sure if it's intentional or not.
Retains it's structure on a single line ✅
{{ svg("path/to/file.svg") }}
Retains it's structure on a single line ✅
{{ svg("path/to/file.svg")|attr }}
Suddenly breaks onto many lines ⚠️
{{
svg("path/to/file.svg")|attr({
class: "w-6 h-6",
})
}}
What I would expect
The object follows the value of the twigAlwaysBreakObjects option and everything else stays as it was.
{{ svg("path/to/file.svg")|attr({
class: "w-6 h-6",
}) }}
When using Craft CMS' svg function there is some slightly odd behavior, not sure if it's intentional or not.
Retains it's structure on a single line ✅
{{ svg("path/to/file.svg") }}Retains it's structure on a single line ✅
{{ svg("path/to/file.svg")|attr }}Suddenly breaks onto many lines⚠️
{{ svg("path/to/file.svg")|attr({ class: "w-6 h-6", }) }}What I would expect
The object follows the value of the
twigAlwaysBreakObjectsoption and everything else stays as it was.{{ svg("path/to/file.svg")|attr({ class: "w-6 h-6", }) }}