improvement(gmail): replace custom html-to-text regex with library#4613
Conversation
…xt library Resolves 4 CodeQL alerts on htmlToPlainText (incomplete tag/entity handling, unsafe regex backtracking). Delegates to the html-to-text npm package already used by the outlook polling trigger and the mail/send route.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Configures conversion behavior (no word-wrapping, skip Reviewed by Cursor Bugbot for commit 7cbf02a. Configure here. |
Greptile SummaryReplaces the custom regex-based
Confidence Score: 5/5Safe to merge — the change is a straightforward library substitution with no new dependencies, matching an existing pattern in the repo. The swap touches only one function in one file, reuses a library and configuration already proven elsewhere in the codebase, and is backed by an updated test suite that covers the behavioral differences introduced by the library (paragraph spacing, handling, anchor URL suppression). No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["htmlToPlainText(html)"] --> B["convert(html, options)\nhtml-to-text library"]
B --> C["wordwrap: false"]
B --> D["selectors config"]
D --> E["a: hideLinkHrefIfSameAsText\n+ noAnchorUrl"]
D --> F["img: skip"]
D --> G["script: skip"]
D --> H["style: skip"]
B --> I["Plain-text string\n(trimmed, entities decoded)"]
Reviews (2): Last reviewed commit: "improvement(gmail): match outlook select..." | Re-trigger Greptile |
…ests Aligns html-to-text options with apps/sim/lib/webhooks/polling/outlook.ts: suppress anchor hrefs when identical to text, drop bare # anchors, skip img/script/style content. Adds tests for nbsp preservation and anchor behavior.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7cbf02a. Configure here.
Summary
Type of Change
Testing
Checklist