Skip to content

fix: prevent invalid HTML by discarding incomplete tags during text truncation - #2773

Merged
andrewleith merged 3 commits into
mainfrom
fix/redaction-creates-invalid-html
Aug 31, 2026
Merged

fix: prevent invalid HTML by discarding incomplete tags during text truncation#2773
andrewleith merged 3 commits into
mainfrom
fix/redaction-creates-invalid-html

Conversation

@andrewleith

Copy link
Copy Markdown
Member

Summary | Résumé

This pull request improves the _truncate_text_preserving_markup function in app/main/views/jobs.py to handle HTML markup more safely during text truncation. The main change ensures that if truncation cuts off part of an HTML tag, the incomplete tag is discarded, preventing broken markup in the output.

Test instructions | Instructions pour tester la modification

@github-actions

Copy link
Copy Markdown

@andrewleith
andrewleith requested a lite review from Copilot August 27, 2026 19:07

@jimleroyer jimleroyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - nice set of tests

@andrewleith
andrewleith merged commit d1f6547 into main Aug 31, 2026
13 checks passed
@andrewleith
andrewleith deleted the fix/redaction-creates-invalid-html branch August 31, 2026 12:33
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.

2 participants