Skip to content

fix: prevent invalid rich text payload submissions in question editor#19

Open
Sanjay-Hub-Dev wants to merge 1 commit into
Ashmita1206:mainfrom
Sanjay-Hub-Dev:fix/richtext-empty-question-validation
Open

fix: prevent invalid rich text payload submissions in question editor#19
Sanjay-Hub-Dev wants to merge 1 commit into
Ashmita1206:mainfrom
Sanjay-Hub-Dev:fix/richtext-empty-question-validation

Conversation

@Sanjay-Hub-Dev
Copy link
Copy Markdown

Description

Fixed an issue where the rich text editor allowed empty or invalid formatted payloads to be submitted as questions.

Previously, visually empty editor content such as empty HTML structures (for example <p><br></p>) bypassed validation checks because validation was being performed directly on the raw HTML string instead of actual plain text content.

This could lead to broken or inconsistent question states being created.

Changes Made

  • Added plain text extraction before validation
  • Prevented empty/invalid rich text submissions
  • Updated submit button validation logic
  • Improved character count handling for editor content
  • Ensured validation checks only meaningful user-entered text

Files Modified

  • client/src/pages/AskQuestionPage.jsx

Validation

  • Verified empty editor submissions are blocked
  • Tested whitespace-only and empty formatted content scenarios
  • Confirmed valid formatted content still submits correctly
  • Ensured no regression in existing rich text editor functionality

Fixes #8

@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

@Sanjay-Hub-Dev is attempting to deploy a commit to the ashmitagoyal1206-7687's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Question Editor Accepts Empty/Invalid Rich Text Payloads Causing Broken Question States [BUG}

1 participant