How to use the domelementtype.Tag function in domelementtype

To help you get started, we’ve selected a few domelementtype 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 broadly / css-inliner / lib / inline_rules.js View on Github external
function applyRulesRecursively(nodes, matchers) {
  for (let node of nodes) {
    const isElement = (node.type === ElementType.Tag);
    // HTML  element is only thing that can't get styled
    const isHead    = (isElement && node.name === 'head');

    if (isElement && !isHead) {
      applyRulesToElement(node, matchers);
      applyRulesRecursively(node.children, matchers);
    }
  }
}
github broadly / css-inliner / lib / inline_rules.js View on Github external
function isStylableElement(node) {
  // This selects most elements, except 
github ctx-core / ctx-core / packages / sass / svelte.ts View on Github external
const promise_a1 = map(dom, async node=>{
			if (
				node.type === ElementType.Tag
				&& node.name == 'svelte:head'
			) {
				const $ = cheerio.load(node)
				const promise_a1 = map(
					$(`style[type='text/sass'], style[type='text/scss']`),
					async style_node=>{
						const text_node = style_node.firstChild
						const { data } = text_node
						const { code } = await render__sass(opts__builder, {
							filename,
							content: data,
							attributes,
						})
						style_node.attribs.type = 'text/css'
						delete style_node.attribs.global
						text_node.data = code
github superRaytin / puzzler / node_modules / cheerio / node_modules / htmlparser2 / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onopentag = function(name, attribs){
	var element = {
		type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
		name: name,
		attribs: attribs,
		children: []
	};

	this._addDomElement(element);

	this._tagStack.push(element);
};
github kapetan / repaint / source / html.js View on Github external
}, function(element) {
		if(element.type === ElementType.Script) scripts.push(element);
		if(element.type === ElementType.Style) stylesheets.push(element);
		if(element.type === ElementType.Tag && element.name === 'link' && element.attribs.rel === 'stylesheet') stylesheets.push(element);
		if(element.type === ElementType.Tag && element.name === 'img') images.push(element);
		if(element.type === ElementType.Tag && element.name === 'a') anchors.push(element);
		if(element.type === ElementType.Tag && element.name === 'title') title = element;
	});
github kapetan / repaint / source / html.js View on Github external
}, function(element) {
		if(element.type === ElementType.Script) scripts.push(element);
		if(element.type === ElementType.Style) stylesheets.push(element);
		if(element.type === ElementType.Tag && element.name === 'link' && element.attribs.rel === 'stylesheet') stylesheets.push(element);
		if(element.type === ElementType.Tag && element.name === 'img') images.push(element);
		if(element.type === ElementType.Tag && element.name === 'a') anchors.push(element);
		if(element.type === ElementType.Tag && element.name === 'title') title = element;
	});

domelementtype

all the types of nodes in htmlparser2's dom

BSD-2-Clause
Latest version published 2 years ago

Package Health Score

65 / 100
Full package analysis