Skip to content

MKT-11951#220

Merged
abhishek305 merged 35 commits intodevelopmentfrom
MKT-11951
Jun 3, 2025
Merged

MKT-11951#220
abhishek305 merged 35 commits intodevelopmentfrom
MKT-11951

Conversation

@abhishek305
Copy link
Contributor

Changes

  • Renamed removeHTMLTags to sanitizeHTMLContent for better clarity
  • Improved HTML content sanitization to preserve text with angle brackets
  • Added two-step sanitization process for better content cleaning
  • Proper string validation for component's html prop

Before

  • Aggressive regex /<[^>]*>?|style="[^"]*"/g would remove all content between < and >
  • The app was breaking after importing the user's CSV because it interpreted a column that had cells as boolean & the component didn't accept anything other than a string.

After

  • Improved regex preserves text content with angle brackets
  • Two-step sanitization:
    1. Removes inline styles
    2. Removes HTML tags while preserving text content
  • Text like "Kitten (<1 year)" remains intact
  • Proper string check when data is being rendered into a table.

@abhishek305 abhishek305 requested review from a team, Amitkanswal and MaitriGurey1 May 30, 2025 15:23
@abhishek305 abhishek305 merged commit 3989c6f into development Jun 3, 2025
7 checks passed
@abhishek305 abhishek305 deleted the MKT-11951 branch June 3, 2025 07:04
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.

4 participants