Skip to content

Conversation

@nani-samireddy
Copy link
Contributor

What?

Closes #71741

This PR updates the Accordion Header block to use the withoutInteractiveFormatting prop in RichText, instead of hardcoding a limited list of allowedFormats.

Why?

Currently, the Accordion Header places a RichText component inside a .
This code does not prevent the insertion of interactive elements, as consumers may add custom formatting.

Using withoutInteractiveFormatting ensures that only safe, non-interactive text formats (bold, italic, strikethrough, etc.) are allowed, and interactive content tags are automatically blocked. This makes the block more robust and future-proof.

How?

Removed the hardcoded allowedFormats array.
Added withoutInteractiveFormatting to the Accordion Header’s RichText component.
No change in the user experience for text styling

Testing Instructions

  1. Create or edit a post or page.
  2. Insert an Accordion block.
  3. Add text to the Accordion Header.
  4. Try applying basic formatting (bold, italic, strikethrough) → ✅ works.
  5. Try inserting interactive elements such as links or media → ❌ not allowed.

@nani-samireddy nani-samireddy marked this pull request as ready for review September 19, 2025 04:25
@github-actions
Copy link

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin, New Block.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions
Copy link

github-actions bot commented Sep 19, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: nani-samireddy <nanisamireddy@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] Accordion Affects the Accordion Block labels Sep 19, 2025
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Thanks, @nani-samireddy!

@Mamaduka Mamaduka added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Sep 19, 2025
@github-actions github-actions bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Sep 19, 2025
@Mamaduka Mamaduka merged commit fd62fb2 into WordPress:trunk Sep 19, 2025
88 of 92 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.8 milestone Sep 19, 2025
adamsilverstein pushed a commit to adamsilverstein/gutenberg that referenced this pull request Sep 22, 2025
…ats (WordPress#71745)

Co-authored-by: nani-samireddy <nanisamireddy@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Accordion Affects the Accordion Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accordion Header: use withoutInteractiveFormatting prop instead of hardcoded formatt list

2 participants