fix(autolinker): Always override title attribute #2056

This commit is contained in:
Ben Gotow 2016-04-26 16:49:33 -07:00
parent e4a0c94482
commit aa42040813

View file

@ -58,7 +58,7 @@ export function autolink(doc, {async} = {}) {
// Traverse the new DOM tree and make sure everything with an href has a title. // Traverse the new DOM tree and make sure everything with an href has a title.
const aTagWalker = document.createTreeWalker(doc.body, NodeFilter.SHOW_ELEMENT, { const aTagWalker = document.createTreeWalker(doc.body, NodeFilter.SHOW_ELEMENT, {
acceptNode: (node) => acceptNode: (node) =>
(node.href && !node.title) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP node.href ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
, ,
}); });
while (aTagWalker.nextNode()) { while (aTagWalker.nextNode()) {