dexterouslogic / super-simple-highlighter

A chrome extension which highlights text on a web page, and attempts to restore it on returning
GNU General Public License v3.0
144 stars 55 forks source link

Escapes CSS to deal with ID that starts with a number #17

Closed mklilley closed 2 years ago

mklilley commented 2 years ago

This PR updates utils.js to add CSS escaping to querySelectorAll. This is to deal with the case when the ID of the element starts with a numerical value, e.g. 2cdb. Try out super simple highligher on this article and you'll see the code erroring in the console when you try and highlight.

CSS escape seems to be compatible with all modern browsers.