Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var getElement = function (domExpression, query) {
var htmlCode = emmet.expandAbbreviation(domExpression, {html: 'xhtml'});
var document = parse(htmlCode);
return document.querySelector(query || getFirstTag(domExpression));
};
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;
};
var getElement = function (domExpression, query) {
var htmlCode = emmet.expandAbbreviation(domExpression, {html: 'xhtml'});
var document = parse(htmlCode);
return document.querySelector(query || getFirstTag(domExpression));
};
template.addHelper('zen', function (value) {
return emmet.expandAbbreviation(value);
});
function getHTMLElement(template) {
const html = expand(template);
const doc = new JSDOM().window.document;
const dom = doc.createElement('div');
dom.innerHTML = html;
return dom.firstChild;
}