-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix: strip user-icon avatars from Notion HTML import (#13703) #13718
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
base: canary
Are you sure you want to change the base?
fix: strip user-icon avatars from Notion HTML import (#13703) #13718
Conversation
|
WalkthroughAdds a Notion HTML inline matcher to skip user-icon elements by inserting a space in Delta output, includes it in the adapter exports, adds a unit test covering user icons, and removes the iOS SwiftPM Package.resolved file. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant H as Notion HTML
participant A as InlineToDeltaAdapter
participant M as user-icon Matcher
participant D as Delta
H->>A: Parse elements
A->>M: Element classList contains "user-icon"?
alt user-icon matched
M-->>A: Return insert " "
A->>D: Append " "
else not matched
A->>D: Process via other rules
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
⛔ Files ignored due to path filters (5)
📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🧰 Additional context used🧬 Code graph analysis (2)blocksuite/affine/inlines/preset/src/adapters/notion-html/html-inline.ts (1)
blocksuite/affine/all/src/__tests__/adapters/notion-html.unit.spec.ts (2)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont change file mode and remove non-required file changes
Problem
When importing Notion HTML exports to AFFiNE, user avatars in database Person columns were being imported as large images at the top of pages instead of being properly handled.
Solution
notionHtmlUserIconToDeltaMatcher
to specifically handle elements withuser-icon
classExample
Before: Large avatar images appeared at the top of imported pages
After: Clean text like "Name with avatar CXXXX(Another name without avatar) KXXXX(2nd name without avatar)"
Testing
Summary by CodeRabbit