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

Prevent element highlighting from highlighting the entire page #191

Open
swoh816 opened this issue Nov 20, 2024 · 2 comments
Open

Prevent element highlighting from highlighting the entire page #191

swoh816 opened this issue Nov 20, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@swoh816
Copy link

swoh816 commented Nov 20, 2024

Describe the solution you'd like

Problem: In the current version, you can select the entire document in highlight mode, overriding all the sentence and paragraph highlights. I don't think the document-wise highlight can go, because if I want to highlight the entire document, I can just clip it without highlighting anything.

Solution: Disable document-wise highlight in highlight mode.

@swoh816 swoh816 added the enhancement New feature or request label Nov 20, 2024
@kepano
Copy link
Collaborator

kepano commented Nov 20, 2024

The extension already does this to some extent. It blocks highlighting the html and body elements. However some websites have large div containers that might contain the entire page. Since we do still want to have element highlighting it's tricky to differentiate between which elements should be allowed and which shouldn't.

Some ideas that come to mind:

  • An option to disable element highlighting, for everything except for paragraphs and images
  • A modifier key that temporarily disables element highlighting

In the meantime you can also use Cmd+Z to cancel a highlight if you accidentally highlight the background.

@kepano kepano changed the title Disable document-wise highlight in highlight mode Prevent element highlighting from highlighting the entire page Nov 20, 2024
@kepano kepano added the help wanted Extra attention is needed label Nov 20, 2024
@swoh816
Copy link
Author

swoh816 commented Nov 20, 2024

Indeed, only after I clicked the document in highlight mode, screaming out I lost all the highlights, I found out I can undo using Cmd+Z and I was relieved. (I think it'd also be helpful to have Cmd+Shift+Z or Cmd+Y or as well, because once you undo, you can't redo at the moment.)

I agree it's tricky. I like the way it can highlight any element in the document (except the entire document). Potentially, traversing the hierarchy of tags could resolve it. For example, filter the parent nodes that contain children nodes with <p> tags or <img> tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants