Join the Webstudio community

Updated 5 months ago

HTML Embed automatically adds \

At a glance

The community member is using an HTML embed and noticed backslashes in the expression editor. Another community member explained that the backslashes are used to escape double quotes inside JavaScript double quotes, to make them distinct. A third community member suggested using single quotes instead to avoid this issue.

Using an HTML Embed, I'm pasting in:
Plain Text
<iframe src="" width="100%" height="100%" style="border:none; overflow: hidden" scrolling="no" frameborder="0" allowfullscreen="true"></iframe>


Within the expression editor I see all these \ (backslash is the definitation, right?).

Why is that?
Attachment
image.png
B
R
O
3 comments
Because double quotes inside js double quotes need to be distinct so they are escaped with backslash
you could use single quotes in one of the cases to avoid this
Add a reply
Sign up and join the conversation on Discord