How to use the simple-html-tokenizer.Tokenizer function in simple-html-tokenizer

To help you get started, we’ve selected a few simple-html-tokenizer 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 WordPress / gutenberg / packages / blocks / src / api / validation / index.js View on Github external
function getHTMLTokens( html, logger = createLogger() ) {
	try {
		return new Tokenizer( new DecodeEntityParser() ).tokenize( html );
	} catch ( e ) {
		logger.warning( 'Malformed HTML detected: %s', html );
	}

	return null;
}
github gambitph / Stackable / src / plugins / auto-block-recovery / is-invalid.js View on Github external
function getHTMLTokens( html ) {
	try {
		return new Tokenizer( new DecodeEntityParser() ).tokenize( html )
	} catch ( e ) {
	}

	return null
}