diff --git a/workflowy-helper/main.js b/workflowy-helper/main.js index b2e3b7e..b1c425d 100644 --- a/workflowy-helper/main.js +++ b/workflowy-helper/main.js @@ -155,8 +155,8 @@ const breadcrumbs = breadcrumb.querySelectorAll('a'); breadcrumbs.forEach(bc => { var text = bc.innerText.trim(); - if (hotspots.some(hotspot => text.includes(hotspot))) { - const hotspot = hotspots.find(hotspot => text.includes(hotspot)); + if (hotspots.includes(text)) { + const hotspot = text; projectNode.classList.add(`hotspot-${hotspot}`); } }); @@ -166,8 +166,8 @@ if (ns.length > 0) { const n = ns[0]; const text = safeGetContent(n, ".content > .innerContentContainer"); - if (hotspots.some(hotspot => text.includes(hotspot))) { - const hotspot = hotspots.find(hotspot => text.includes(hotspot)); + if (hotspots.includes(text)) { + const hotspot = text; projectNode.classList.add(`hotspot-${hotspot}`); const children = projectNode.querySelectorAll('.project'); children.forEach(child => {