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.
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.