How to use the entities/lib/decode_codepoint.js function in entities

To help you get started, we’ve selected a few entities 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 wayfair / tungstenjs / src / template / compiler / decoder.js View on Github external
return function replace(str) {
    if (str.charAt(1) === '#') {
      if (str.charAt(2) === 'X' || str.charAt(2) === 'x') {
        return decodeCodePoint(parseInt(str.substr(3), 16));
      }
      return decodeCodePoint(parseInt(str.substr(2), 10));
    }
    return map[str.slice(1, -1)];
  };
}
github mowlc / real-estate-scraper / node_modules / htmlparser2 / lib / Tokenizer.js View on Github external
Tokenizer.prototype._decodeNumericEntity = function(offset, base){
	var sectionStart = this._sectionStart + offset;

	if(sectionStart !== this._index){
		//parse entity
		var entity = this._buffer.substring(sectionStart, this._index);
		var parsed = parseInt(entity, base);

		this._emitPartial(decodeCodePoint(parsed));
		this._sectionStart = this._index;
	} else {
		this._sectionStart--;
	}

	this._state = this._baseState;
};
github victorporof / Sublime-JSHint / scripts / node_modules / htmlparser2 / lib / Tokenizer.js View on Github external
Tokenizer.prototype._decodeNumericEntity = function(offset, base){
	var sectionStart = this._sectionStart + offset;

	if(sectionStart !== this._index){
		//parse entity
		var entity = this._buffer.substring(sectionStart, this._index);
		var parsed = parseInt(entity, base);

		this._emitPartial(decodeCodePoint(parsed));
		this._sectionStart = this._index;
	} else {
		this._sectionStart--;
	}

	this._state = this._baseState;
};
github wayfair / tungstenjs / src / template / compiler / decoder.js View on Github external
return function replace(str) {
    if (str.charAt(1) === '#') {
      if (str.charAt(2) === 'X' || str.charAt(2) === 'x') {
        return decodeCodePoint(parseInt(str.substr(3), 16));
      }
      return decodeCodePoint(parseInt(str.substr(2), 10));
    }
    return map[str.slice(1, -1)];
  };
}
github fb55 / htmlparser2 / lib / Tokenizer.js View on Github external
Tokenizer.prototype._decodeNumericEntity = function(offset, base) {
    var sectionStart = this._sectionStart + offset;

    if (sectionStart !== this._index) {
        //parse entity
        var entity = this._buffer.substring(sectionStart, this._index);
        var parsed = parseInt(entity, base);

        this._emitPartial(decodeCodePoint(parsed));
        this._sectionStart = this._index;
    } else {
        this._sectionStart--;
    }

    this._state = this._baseState;
};
github thomasjbradley / markbot / app / checks / html / best-practices / htmlparser / Tokenizer.js View on Github external
Tokenizer.prototype._decodeNumericEntity = function(offset, base){
  var sectionStart = this._sectionStart + offset;

  if(sectionStart !== this._index){
    //parse entity
    var entity = this._buffer.substring(sectionStart, this._index);
    var parsed = parseInt(entity, base);

    this._emitPartial(decodeCodePoint(parsed));
    this._sectionStart = this._index;
  } else {
    this._sectionStart--;
  }

  this._state = this._baseState;
};
github Rainbox-dev / DuAEF_Duik / Release / Duik-API / src-doc / tui-jsdoc-template / node_modules / htmlparser2 / lib / Tokenizer.js View on Github external
Tokenizer.prototype._decodeNumericEntity = function(offset, base) {
    var sectionStart = this._sectionStart + offset;

    if (sectionStart !== this._index) {
        //parse entity
        var entity = this._buffer.substring(sectionStart, this._index);
        var parsed = parseInt(entity, base);

        this._emitPartial(decodeCodePoint(parsed));
        this._sectionStart = this._index;
    } else {
        this._sectionStart--;
    }

    this._state = this._baseState;
};
github charlielin99 / Jobalytics / node_modules / htmlparser2 / lib / Tokenizer.js View on Github external
Tokenizer.prototype._decodeNumericEntity = function(offset, base){
	var sectionStart = this._sectionStart + offset;

	if(sectionStart !== this._index){
		//parse entity
		var entity = this._buffer.substring(sectionStart, this._index);
		var parsed = parseInt(entity, base);

		this._emitPartial(decodeCodePoint(parsed));
		this._sectionStart = this._index;
	} else {
		this._sectionStart--;
	}

	this._state = this._baseState;
};