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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/emojify.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,15 @@

var nodes = [];

var elementsBlacklist = new RegExp(defaultConfig.blacklist.elements.join('|'), 'i'),
var elementsBlacklist = new RegExp('^(' + defaultConfig.blacklist.elements.join('|') + ')$', 'i'),
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?

return win.NodeFilter.FILTER_ACCEPT;
}
Expand Down Expand Up @@ -342,7 +342,7 @@
){
return false;
}
if (node.nodeType === 1) {
if (node.nodeType === node.ELEMENT_NODE) {
return true;
}

Expand Down