Villhellm / custom-sidebar

Custom Sidebar for Home Assistant
115 stars 23 forks source link

Use textContent instead of innerHTML for title matching #46

Open bmcclure opened 1 year ago

bmcclure commented 1 year ago

This is in regards to the issue I posted a little while ago, https://github.com/Villhellm/custom-sidebar/issues/45.

I tested the change and it does seem to fix the issue I was having with exact matching. Now, it matches all of my titles properly even when they all use exact matching, whereas before it only matched a few of them with exact matching due to HTML comments.

innerText could also possibly work, but I think textContent is a better choice because it includes only visible text and also merges text from child elements.