Skip to content

fix(cve5): normalise whitespace in notification emails - #289

Open
Anurag-S1ngh wants to merge 1 commit into
apache:mainfrom
Anurag-S1ngh:fix/169-email-whitespace
Open

Anurag-S1ngh wants to merge 1 commit into
apache:mainfrom
Anurag-S1ngh:fix/169-email-whitespace

Conversation

@Anurag-S1ngh

Copy link
Copy Markdown

Summary

Normalises the text that goes into notification emails. Runs of spaces and tabs collapse to one space, hard-wrapped lines are joined, and paragraph breaks and list items are preserved.

Changes

  • Add a tidyEmailText helper in custom/cve5/edit.pug
  • Apply it to descriptions, configurations, solutions, workarounds, credits, and timeline entries

Testing

  • Checked the helper against the examples from the issue
  • npm run unittest: passes
  • Template compiles

Closes #169

@raboof

raboof commented Nov 19, 2026

Copy link
Copy Markdown
Member

I wonder if it wouldn't make sense to apply this earlier, in htmltoText in ./default/cve5/script.js ?

@Anurag-S1ngh

Copy link
Copy Markdown
Author

The fields in the email are plain text from the CVE record and never go through htmltoText, which is used for HTML such as comment plainText and supportingMedia rendering. Folding the reflow into it would change those callers, where newlines are significant. Would moving tidyEmailText into script.js as a shared exported helper next to htmltoText work instead? That keeps the behaviour scoped to the email path and makes it unit-testable and reusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove spurious whitespace from notification emails

2 participants