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

DOM changes to insert highlights around text blocked in Notion #5069

Open
dwhly opened this issue Dec 14, 2022 · 2 comments
Open

DOM changes to insert highlights around text blocked in Notion #5069

dwhly opened this issue Dec 14, 2022 · 2 comments
Labels

Comments

@dwhly
Copy link
Member

dwhly commented Dec 14, 2022

The selected highlight and the ability to scroll to the highlight by the H annotation client aren't working on Notion web pages-- presumably because our mutations that wrap text nodes in <hypothesis-highlight> elements get stripped out.

We get console warnings like the following:

Screenshot 2022-12-14 at 6 41 37 AM

I noticed a similar issue on another project, which ultimately was resolved... possibly in the new editor launched earlier in the year?:
obahareth/notion-rtl#28 (comment)

Given that web annotation and the mechanisms to make it work on the DOM are a larger class of problem I'm curious if there are elegant ways of addressing this, possibly collaboratively between teams.

@robertknight robertknight changed the title DOM changes blocked by Notion DOM changes to insert highlights around text blocked in Notion Dec 14, 2022
@dwhly
Copy link
Member Author

dwhly commented Dec 16, 2022

@justjake We'd be thankful for any perspective you could share here.

@leedenison leedenison added the bug label May 24, 2023
@robertknight
Copy link
Member

robertknight commented Sep 25, 2023

Given that web annotation and the mechanisms to make it work on the DOM are a larger class of problem I'm curious if there are elegant ways of addressing this, possibly collaboratively between teams.

The CSS Highlight API allows creating highlights without modifying the DOM, so can be used in some cases to avoid creating a conflict with the page's own UI rendering. The current API is missing direct support for interactive highlights. It also faces the theoretical problem that the web application could choose to re-render the UI and "destroy" the highlights at any time.

The other direction is to take some kind of static snapshot of the UI and annotate that.

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

No branches or pull requests

3 participants