How to use the twemoji.test function in twemoji

To help you get started, we’ve selected a few twemoji 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 Automattic / wp-calypso / client / components / tinymce / plugins / wpemoji / plugin.js View on Github external
function parseNode( node ) {
		let selection, bookmark;

		if ( node && twemoji.test( node.textContent || node.innerText ) ) {
			if ( env.webkit ) {
				selection = editor.selection;
				bookmark = selection.getBookmark();
			}

			replaceEmoji( node );

			if ( env.webkit ) {
				selection.moveToBookmark( bookmark );
			}
		}
	}
github Automattic / wp-calypso / client / components / tinymce / plugins / wpemoji / plugin.js View on Github external
tinymce.each( editor.dom.$( 'img.emoji', event.node ), function( image ) {
			if ( image.alt && twemoji.test( image.alt ) ) {
				setImgAttr( image );
			}
		} );
	} );

twemoji

A Unicode standard based way to implement emoji across all platforms.

MIT
Latest version published 2 years ago

Package Health Score

68 / 100
Full package analysis