Skip to content

fix(faq): render HTML markup in FAQ answers instead of raw text - #7973

Open
AnkitRewar11 wants to merge 1 commit into
layer5io:masterfrom
AnkitRewar11:fix-faq-html-tags
Open

fix(faq): render HTML markup in FAQ answers instead of raw text#7973
AnkitRewar11 wants to merge 1 commit into
layer5io:masterfrom
AnkitRewar11:fix-faq-html-tags

Conversation

@AnkitRewar11

@AnkitRewar11 AnkitRewar11 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Description
This PR fixes #7953

Fixes the FAQ section on the Playground page where raw HTML tags (e.g. <sup>BETA</sup>&nbsp;) were being displayed as plain text instead of being rendered properly.

Root cause: src/sections/General/Faq/index.js was rendering FAQ answers using plain text interpolation (<p>{ans}</p>), which causes React to escape HTML characters instead of parsing them. Updated it to use dangerouslySetInnerHTML so the markup (like <sup>BETA</sup> and &nbsp;) renders correctly, since the FAQ data is sourced internally from src/assets/data/faq/index.js and is trusted.

Notes for Reviewers

  • Only 1 line changed in src/sections/General/Faq/index.js.
  • Tested locally by running the FAQ page and confirming the BETA label now renders as proper superscript with no raw tags visible.

Signed commits

  • Yes, I signed my commits.

Before
Screenshot 2026-08-12 at 7 00 39 AM

After
Screenshot (695)

Summary by CodeRabbit

  • New Features
    • FAQ answers now support rich HTML formatting for improved readability and presentation.

Signed-off-by: ankitrewar11 <rewarankit18@gmail.com>
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a818441b-7b7a-491b-80f9-311a7aed7116

📥 Commits

Reviewing files that changed from the base of the PR and between 2ccf887 and 9383778.

📒 Files selected for processing (1)
  • src/sections/General/Faq/index.js

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The FAQ component now renders answer strings as HTML, allowing markup such as <sup> and &nbsp; to display correctly.

Changes

FAQ rendering

Layer / File(s) Summary
Render FAQ answers as HTML
src/sections/General/Faq/index.js
FAQ answers are rendered as HTML markup instead of escaped text.

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 93837

This localized change renders trusted FAQ markup correctly instead of showing raw tags, with no actionable merge-blocking risk remaining after normal checks and review.

Suggested reviewers: nstkrishna

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the FAQ rendering fix and matches the primary change.
Linked Issues check ✅ Passed The change renders FAQ HTML and addresses the required superscript BETA markup without exposing raw tags [#7953].
Out of Scope Changes check ✅ Passed The only changed line directly supports the linked issue, and no unrelated changes are shown.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/sections/General/Faq/index.js

Parsing error: The keyword 'import' is reserved


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for PR #7973 removed.

This PR preview was automatically pruned because we keep only the 3 most recently updated previews on GitHub Pages to stay within deployment size limits.

If needed, push a new commit to this PR to generate a fresh preview.

@dhruveshmishra dhruveshmishra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minimal changes ,preview looks good ,LGTM

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.

Raw <sup>BETA</sup>&nbsp; Tags Displayed in Playground FAQ

3 participants