How to use the domelementtype.Directive 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 kuhnza / cheerio-repl / node_modules / cheerio / node_modules / htmlparser2 / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onprocessinginstruction = function(name, data){
	this._addDomElement({
		name: name,
		data: data,
		type: ElementType.Directive
	});
};
github victorporof / Sublime-JSHint / scripts / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onprocessinginstruction = function(name, data){
	this._addDomElement({
		name: name,
		data: data,
		type: ElementType.Directive
	});
};
github substance / substance / dom / _domSerializer.js View on Github external
function render(dom, opts) {
  if (!Array.isArray(dom)) dom = [dom]
  opts = opts || {}

  let output = []

  for(var i = 0; i < dom.length; i++){
    let elem = dom[i]

    if (elem.type === 'root') {
      output.push(render(elem.childNodes, opts))
    } else if (ElementType.isTag(elem)) {
      output.push(renderTag(elem, opts))
    } else if (elem.type === ElementType.Directive) {
      output.push(renderDirective(elem))
    } else if (elem.type === ElementType.Comment) {
      output.push(renderComment(elem))
    } else if (elem.type === ElementType.CDATA) {
      output.push(renderCdata(elem))
    } else {
      output.push(renderText(elem, opts))
    }
  }

  return output.join('')
}
github csxiaoyaojianxian / JavaScriptStudy / 09-Tools / 01-webpack / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onprocessinginstruction = function(name, data){
	this._addDomElement({
		name: name,
		data: data,
		type: ElementType.Directive
	});
};
github davidmerfield / Blot / app / node_modules / finder / lib / node_modules / cheerio / node_modules / dom-serializer / index.js View on Github external
var render = module.exports = function(dom, opts) {
  if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];
  opts = opts || {};

  var output = '';

  for(var i = 0; i < dom.length; i++){
    var elem = dom[i];

    if (elem.type === 'root')
      output += render(elem.children, opts);
    else if (ElementType.isTag(elem))
      output += renderTag(elem, opts);
    else if (elem.type === ElementType.Directive)
      output += renderDirective(elem);
    else if (elem.type === ElementType.Comment)
      output += renderComment(elem);
    else if (elem.type === ElementType.CDATA)
      output += renderCdata(elem);
    else
      output += renderText(elem, opts);
  }

  return output;
};
github neftjs / neft / Element / impls / htmlparser / stringify.js View on Github external
function getOuterHTML(elem){
	if (!elem.visible) return;

	switch(elem.type){
	case ElementType.Text:
		return elem.data;
	case ElementType.Comment:
		return "";
	case ElementType.Directive:
		return "<" + elem.data + ">";
	case ElementType.CDATA:
		return "";
	}

	if (exports.omit && ~exports.omit.indexOf(elem.name)) return getInnerHTML(elem);

	var ret = "<" + elem.name;
	if("attribs" in elem){
		for(var attr in elem.attribs){
			if(elem.attribs.hasOwnProperty(attr)){
				ret += " " + attr;
				var value = elem.attribs[attr];
				if(value == null){
					if( !(attr in booleanAttribs) ){
						ret += '=""';
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.onprocessinginstruction = function(name, data){
	this._addDomElement({
		name: name,
		data: data,
		type: ElementType.Directive
	});
};
github cheeriojs / dom-serializer / index.js View on Github external
var render = (module.exports = function(dom, opts) {
  if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];
  opts = opts || {};

  var output = '';

  for (var i = 0; i < dom.length; i++) {
    var elem = dom[i];

    if (elem.type === 'root') output += render(elem.children, opts);
    else if (ElementType.isTag(elem)) output += renderTag(elem, opts);
    else if (elem.type === ElementType.Directive)
      output += renderDirective(elem);
    else if (elem.type === ElementType.Comment) output += renderComment(elem);
    else if (elem.type === ElementType.CDATA) output += renderCdata(elem);
    else output += renderText(elem, opts);
  }

  return output;
});
github charlielin99 / Jobalytics / node_modules / domhandler / index.js View on Github external
DomHandler.prototype.onprocessinginstruction = function(name, data){
	var element = this._createDomElement({
		name: name,
		data: data,
		type: ElementType.Directive
	});

	this._addDomElement(element);
};

domelementtype

all the types of nodes in htmlparser2's dom

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis