Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
github.com/simplabs/ember-hbs-minifier
Stripping whitespace out of your Handlebars templates
Disclaimer: This is an experiment and might change in the future. Do not use this for production yet unless you understand the consequences!
ember install ember-hbs-minifier
ember-hbs-minifier
will remove unnecessary text nodes from your templates
and collapse whitespace into single space characters. This is all done
automatically for you (without having to use e.g. {{~foo~}}
) but is
disabled for certain situations:
Inside of <pre></pre>
tags
Inside of {{#no-minify}}{{/no-minify}}
blocks
(these will be stripped from the template)
Please note that this does not work across component/template boundaries.
What happens in particular is:
Text nodes containing only whitespace are collapsed to ' '
(a single space character)
Leading or trailing text nodes inside of tags or handlebars blocks containing only whitespace are removed entirely
If you want to disable the whitespace stripping behavior for other tags,
components, or elements with certain CSS classes you can adjust the default
configuration in your ember-cli-build.js
file:
let app = new EmberApp({
'ember-hbs-minifier': {
skip: {
classes: [],
// skip whitespace stripping in `<pre></pre>` tags
elements: ['pre'],
// skip whitespace stripping in `{{#no-minify}}{{/no-minify}}` blocks
components: ['no-minify'],
},
},
});
ember-hbs-minifier is developed by and © simplabs GmbH and contributors. It is released under the MIT License.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.