How to use the emmet.expandAbbreviation function in emmet

To help you get started, we’ve selected a few emmet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ecomfe / htmlcs / test / spec / define.spec.js View on Github external
var getElement = function (domExpression, query) {
    var htmlCode = emmet.expandAbbreviation(domExpression, {html: 'xhtml'});
    var document = parse(htmlCode);
    return document.querySelector(query || getFirstTag(domExpression));
};
github ecomfe / htmlcs / test / spec / nest-rule / index.spec.js View on Github external
var getElement = function (domExpression) {
        var htmlCode = emmet.expandAbbreviation(domExpression, {html: 'xhtml'});
        var document = parse(htmlCode);
        var element = document.querySelector('#target') || document.getElementsByTagName(tag)[0];
        return element;
    };
github ecomfe / htmlcs / test / spec / nest-rule / util.spec.js View on Github external
var getElement = function (domExpression, query) {
    var htmlCode = emmet.expandAbbreviation(domExpression, {html: 'xhtml'});
    var document = parse(htmlCode);
    return document.querySelector(query || getFirstTag(domExpression));
};
github jonschlinkert / template / examples / example.js View on Github external
template.addHelper('zen', function (value) {
  return emmet.expandAbbreviation(value);
});
github adobe / helix-pipeline / src / utils / adjust-markup.js View on Github external
function getHTMLElement(template) {
  const html = expand(template);
  const doc = new JSDOM().window.document;
  const dom = doc.createElement('div');
  dom.innerHTML = html;
  return dom.firstChild;
}