Repository navigation
fix: fix hardcoded colors scheme for exported notes.html - #25033
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bbb-shared-notes-server/src/express/handlers/exportDocumentToHtml.ts`:
- Around line 97-118: The dark-theme CSS only flips base body colors ('html.dark
body') but fails to override surface elements—specifically code/pre blocks,
table cells/headers and blockquotes—so they keep light backgrounds and hurt
contrast; update the stylesheet to add dark-mode overrides for those selectors
(e.g. 'html.dark code', 'html.dark pre', 'html.dark table td', 'html.dark table
th', 'html.dark blockquote') and set their background-color and color to the
dark-mode variables (use the darker --bn-bg-* vars for backgrounds and the
lighter --bn-text-* vars for text) so code/pre/table/blockquote surfaces match
the dark theme.
- Around line 37-42: The current span-attribute cleanup in exportDocumentToHtml
only removes style="..." with double quotes and fails for single quotes or extra
spacing; update the attribute-removal pattern used inside the
htmlContent.replace callback to match style attributes more robustly (e.g.,
handle optional whitespace around = and either single or double-quoted values)
so any style='...' or style = "..." is stripped; target the replacement logic
that currently uses attrs.replace(/\s*style="[^"]*"/, '') and broaden that regex
to something like /\s*style\s*=\s*(?:'[^']*'|"[^"]*")/ to reliably remove inline
style attributes from the captured attrs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d5cb959f-d2e3-4563-8884-f278f94cddb8
📒 Files selected for processing (1)
bbb-shared-notes-server/src/express/handlers/exportDocumentToHtml.ts
|
✅ Automated tests have passed! |
caf9d05
into
bigbluebutton:v3.0.x-develop




What does this PR do?
Previously, when exporting a notes.html, we had to deal with hardcoded colors within inline styles.
To resolve that, I put a color variables scheme based on the actual scheme used by BlockNote for light and dark themes.
Motivation
Other integrations might want to use the dark theme which ended up having low contrast between the text color and the highlighted background (as block-note's highlight colors are really desaturated).
How to test
One can test it by just exporting a BlockNote document in html, pdf, etc., and seeing how it looks (Ideally nothing should change). Moreover, one can also edit the html generated to add a class
class="dark"to the html tag, and in this case achieve the dark theme