azdo-userscripts
azdo-userscripts copied to clipboard
Note and await comment highlighting doesn't handle formatting markup
Noticed someone who wanted to emphasize their note so they bolded the word note. Unfortunately that made the script not recognize it as a note. This keyword identification should ignore formatting markup and leading whitespace.
Context
- Extension Version: 2.49.0
This won't be as easy as it looks. CSS doesn't support regex in their attribute selectors (how I am finding comments via their ARIA label and data-content
attribute), so I can't ignore a set of characters at the front. I'm doing a vanilla "starts with" match that CSS supports via the ^=
operator. More on this here: https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors
Also note, I don't want to change it to *=
because that will match note:
anywhere in the comment, which seems like too much.
To fix this issue, I would have to parse the content in JS and then mark the comment as needing styling. This is more complicated and makes me wonder if we really need it.
Leaving the issue open for more feedback -- or in case I get motivated to fix it later.