Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note and await comment highlighting doesn't handle formatting markup #117

Open
gregr-ni opened this issue Sep 24, 2020 · 1 comment
Open

Comments

@gregr-ni
Copy link

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
@alejandro5042
Copy link
Owner

alejandro5042 commented Sep 24, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants