Skip to content
This repository has been archived by the owner on Oct 3, 2018. It is now read-only.

Fixes #154: cannot render emoji inside a table #165

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fixes #154: cannot render emoji inside a table #165

wants to merge 3 commits into from

Conversation

BoboTiG
Copy link

@BoboTiG BoboTiG commented Apr 26, 2016

With the default black list, node.tagName.match(elementsBlacklist) returned Array['A'] for a table element.
Now it returns null, the correct answer.

Another modification, I used the constant node.ELEMENT_NODE from MDN.

classesBlacklist = new RegExp(defaultConfig.blacklist.classes.join('|'), 'i');

if(typeof win.document.createTreeWalker !== 'undefined') {
var nodeIterator = win.document.createTreeWalker(
el,
win.NodeFilter.SHOW_TEXT | win.NodeFilter.SHOW_ELEMENT,
function(node) {
if(node.nodeType !== 1) {
if(node.nodeType !== node.ELEMENT_NODE) {
/* Text Node? Good! */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this comment still make sense?

@schmunk42
Copy link

This should be merged, especially the current blacklist matches any tag with an A, for example TABLE, see also #154

schmunk42 added a commit to dmstr/yii2-emojifyjs-asset that referenced this pull request Mar 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants