protected function addTag($tagPos, $tagLen, $hex)
	{
		$tag = $this->parser->addSelfClosingTag($this->config['tagName'], $tagPos, $tagLen, 10);

		// Short sequence, only the relevant codepoints are kept
		$seq = str_replace(['-200d', '-fe0f'], '', $hex);
		$tag->setAttribute('seq', $seq);

		// Twemoji sequence, leading zeroes and trailing VS16 are removed
		$tseq = preg_replace('(-fe0f$)', '', ltrim($hex, '0'));
		$tag->setAttribute('tseq', $tseq);
	}
protected function addTag($tagPos, $tagLen, $hex)
	{
		$tag = $this->parser->addSelfClosingTag($this->config['tagName'], $tagPos, $tagLen, 10);

		// Short sequence, only the relevant codepoints are kept
		$seq = str_replace(['-200d', '-fe0f'], '', $hex);
		$tag->setAttribute('seq', $seq);

		// Twemoji sequence, leading zeroes and trailing VS16 are removed
		$tseq = preg_replace('(-fe0f$)', '', ltrim($hex, '0'));
		$tag->setAttribute('tseq', $tseq);
	}
protected function addTag ( $ tagPos , $ tagLen , $ hex ) { $ tag = $ this -> parser -> addSelfClosingTag ( $ this -> config [ 'tagName' ] , $ tagPos , $ tagLen , 10 ) ; // Short sequence, only the relevant codepoints are kept $ seq = str_replace ( [ '-200d' , '-fe0f' ] , '' , $ hex ) ; $ tag -> setAttribute ( 'seq' , $ seq ) ; // Twemoji sequence, leading zeroes and trailing VS16 are removed $ tseq = preg_replace ( '(-fe0f$)' , '' , ltrim ( $ hex , '0' ) ) ; $ tag -> setAttribute ( 'tseq' , $ tseq ) ; }
Add an emoji tag for given sequence

@param  integer $tagPos Position of the tag in the original text
@param  integer $tagLen Length of text consumed by the tag
@param  string  $hex    Full-qualified sequence of codepoints in hex
@return void
Add an emoji tag for given sequence