Emmet abbreviation parser for better-dom
Html strings are annoyingly verbose. Let's fix that with Emmet. Compare the HTML string:
DOM;
to the equivalent micro template
DOM;
Take a look at the Emmet cheat sheet for more examples, but be aware about the differences.
Differences from emmet.io parser
- Element aliases are not supported
- Implied tag names are not supported
a{text}
instead ofa>{text}
is not supported- Operator
^
is not supported - Expandos are not supported
- Boolean attributes (attributes are boolean by default)
- Default attributes are not supported
- Short tags are not supported
Do not be crazy with microtemplates!
Several recommendations from the emmet docs:
Abbreviations are not a template language, they don’t have to be “readable”, they have to be “quickly expandable and removable”.
You don’t really need to write complex abbreviations. Stop thinking that “typing” is the slowest process in web-development. You’ll quickly find out that constructing a single complex abbreviation is much slower and error-prone than constructing and typing a few short ones.
Browser support
Desktop
- Chrome
- Safari 6.0+
- Firefox 16+
- Opera 12.10+
- Internet Explorer 8+ (see notes)
Mobile
- iOS Safari 6+
- Android 2.3+
- Chrome for Android