Improper quote formatting in HubL functions inside of is_json=True
block attributes.
#67
Labels
bug
Something isn't working
is_json=True
block attributes.
#67
Description
When using a function or filter that takes a string inside of a JSON-formatted widget block attribute, all quotes are changed to double-quotes, terminating the string prematurely and causing the function to fail.
Expected behavior
A mixture of double quotes, single quotes, and escaped quotes would be used based on level of quote nesting.
To Reproduce
Original Source Code:
Here, the string passed into
get_asset_url()
is wrapped in single quotes, and the function resolves as expected.Formatted Source Code:
After formatting, the single quotes are replaced with double quotes, setting the value of
img_src
to"{{ get_asset_url("
.Additional context
These quotes are force-reformatted on every save, even if manually changed back. With current documented functionality, the only way to prevent this formatting is to prevent formatting for the entire document.
The text was updated successfully, but these errors were encountered: