How to use the domelementtype.Script 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 davidmerfield / Blot / app / node_modules / finder / lib / 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 victorporof / Sublime-JSHint / scripts / 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 JpEncausse / WSRNodeJS / script / vendor / cheerio / node_modules / htmlparser2 / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onopentag = function(name, attribs){
	var lastTag = this._tagStack[this._tagStack.length - 1];

	var element = {
		type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
		name: name,
		attribs: attribs,
		children: [],
		prev: null,
		next: null,
		parent: lastTag || null
	};

	if(lastTag){
		var idx = lastTag.children.length;
		while(idx > 0){
			if(ElementType.isTag(lastTag.children[--idx])){
				element.prev = lastTag.children[idx];
				lastTag.children[idx].next = element;
				break;
			}
github csxiaoyaojianxian / JavaScriptStudy / 09-Tools / 01-webpack / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onopentag = function(name, attribs){
	var lastTag = this._tagStack[this._tagStack.length - 1];

	var element = {
		type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
		name: name,
		attribs: attribs,
		children: [],
		prev: null,
		next: null,
		parent: lastTag || null
	};

	if(lastTag){
		var idx = lastTag.children.length;
		while(idx > 0){
			if(ElementType.isTag(lastTag.children[--idx])){
				element.prev = lastTag.children[idx];
				lastTag.children[idx].next = element;
				break;
			}
github andrewshawcare / thoughtworks-email-signature-generator / node_modules / grunt-contrib-jshint / node_modules / jshint / 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 davidhealey / waistline / 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 mowlc / real-estate-scraper / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onopentag = function(name, attribs){
	var properties = {
		type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
		name: name,
		attribs: attribs,
		children: []
	};

	var element = this._createDomElement(properties);

	this._addDomElement(element);

	this._tagStack.push(element);
};
github charlielin99 / Jobalytics / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onopentag = function(name, attribs){
	var properties = {
		type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
		name: name,
		attribs: attribs,
		children: []
	};

	var element = this._createDomElement(properties);

	this._addDomElement(element);

	this._tagStack.push(element);
};
github kuhnza / cheerio-repl / node_modules / cheerio / node_modules / htmlparser2 / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onopentag = function(name, attribs){
	var lastTag = this._tagStack[this._tagStack.length - 1];

	var element = {
		type: name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag,
		name: name,
		attribs: attribs,
		children: [],
		prev: null,
		next: null,
		parent: lastTag || null
	};

	if(lastTag){
		var idx = lastTag.children.length;
		while(idx > 0){
			if(ElementType.isTag(lastTag.children[--idx])){
				element.prev = lastTag.children[idx];
				lastTag.children[idx].next = element;
				break;
			}
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