-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
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
Prevent escaping in all languages #985
Conversation
⚡ PR built on Travis and deployed a now preview here:
|
@adam2661 I did some testing and it is still not working well. Take a look at the following: ✅ SCSS/CSS is working❌ HTML is not working as expectedThere is a discrepancy between using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikemai2awesome I setup the same test and got the same result. No space between tags. This is because the code-snippet twig template wraps the content in a spaceless
tag. Whereas the web component skips that part. I'm not sure if it's safe to remove that spaceless
tag or not. I think ideally we'd use spaceless
plus some JS code prettifier?
@adam2661 this is the work @sghoweri did on this file. If you haven't seen this yet, I'm sorry I didn't link to it sooner! You might check it out and see if it solves the problem you are working on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working as expected with the usage of {%- verbatim -%}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, works as expected. Approved!
Jira
http://vjira2:8080/browse/BDS-543
Summary
Apply escaping to all languages in code snippet component.
Details
Changes are only in a js file. It's simple remove of variable and escape without checking language.
How to test
Run this code locally. Go to
localhost:3000/pattern-lab
. Navigate:Styleguide > Sassdocs > View All
then on right navigation Tools:typhography > @mixin bolt-font-family
and/orTools: typhography > @mixin bolt-font-size
and check if&, <, >
are showed unescaped. You can create new pattern-lab page and apply to it:{% include "@bolt-components-code-snippet/code-snippet.twig" with { display: "block", lang: "html", content: "<bolt-list> <bolt-list-item></bolt-list-item> <bolt-list-item></bolt-list-item> <bolt-list-item></bolt-list-item> </bolt-list>" } only %}
to check if all languages are escaped please chengelang
andcontent
variable.