Skip to content

Comments

Fix: Receipt header heading and description nested elements. #8216

Open
gilbert-hernandez wants to merge 3 commits intodevelopfrom
fix/GIVE-3061
Open

Fix: Receipt header heading and description nested elements. #8216
gilbert-hernandez wants to merge 3 commits intodevelopfrom
fix/GIVE-3061

Conversation

@gilbert-hernandez
Copy link

@gilbert-hernandez gilbert-hernandez commented Feb 12, 2026

Resolves GIVE-3061

Description

Receipt header headings and descriptions added nested paragraph elements inside of the h1 and existing p tags after altering the settings for the heading and its description. This

Affects

The confirmation receipt heading in the visual builder and frontend.

Visuals

Here is the existing video of the problem: https://www.loom.com/share/c0b47c14211b40b5a5c491b5642ceada

Testing Instructions

Recreate the problem and ensure that the nested paragraph tags are stripped. The confirmation receipt header should use the correct styles after the content is altered from the default string.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

Comment on lines 82 to 83
<Interweave tagName="h1" className="receipt-header-heading" content={stripWrappingParagraph(heading)} />
<Interweave tagName="p" className="receipt-header-description" content={stripWrappingParagraph(description)} />
Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez i'd like to suggest a different approach. Although this will sort of fix the issue, it will hinder the intended flexibility of these fields. The idea here is customers can use the rich text field to edit the heading and description fields for the donation confirmation - but as you can see we hardcoded the tagName which kind of defeats the purpose of using a rich text 😏

People may want to add additional information to the donation confirmation that should actually render whatever tags they want to use (including p tags)

So what I would suggest, is we make these both wrapped in divs and let the rich text editor determine their tag. Then, we can update the initial styling here to target any tag. (people can always use custom css later to get specific).

I also don't like the fact we are hardcoding an h1 anyway.

We did something similar with the styling of the Form Header

Suggested change
<Interweave tagName="h1" className="receipt-header-heading" content={stripWrappingParagraph(heading)} />
<Interweave tagName="p" className="receipt-header-description" content={stripWrappingParagraph(description)} />
<Interweave tagName="div" className="receipt-header-heading" content={heading} />
<Interweave tagName="div" className="receipt-header-description" content={description} />

Copy link
Author

Choose a reason for hiding this comment

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

@jonwaldstein

That makes sense. I see now that the heading and description are wysiwyg components and the inline styles there will overrule the default style, which are applied to any child element with this update.

Copy link
Contributor

Choose a reason for hiding this comment

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

@gilbert-hernandez yup! thanks for the update.

Copy link
Contributor

@jonwaldstein jonwaldstein Feb 12, 2026

Choose a reason for hiding this comment

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

@gilbert-hernandez oh one more thing - we typically add @unreleased above an existing @since tag to mark the change. You should be able to add one to this file

Copy link
Contributor

@jonwaldstein jonwaldstein left a comment

Choose a reason for hiding this comment

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

@gilbert-hernandez nice job, your a Give dev now!

2 final requests, otherwise ready for QA 🌈

  • Add an @unreleased tag when available
  • Update the PR title to reflect the new direction

@gilbert-hernandez gilbert-hernandez changed the title Fix: Strip nested p tags from receipt header heading and description Fix: Receipt header heading and description nested elements. Feb 12, 2026
@gilbert-hernandez
Copy link
Author

gilbert-hernandez commented Feb 12, 2026

@gilbert-hernandez nice job, your a Give dev now!

2 final requests, otherwise ready for QA 🌈

  • Add an @unreleased tag when available
  • Update the PR title to reflect the new direction

@jonwaldstein
About the @unreleased tag in the docblock, the existing docblock for the DonationReceipt function currently says @SInCE 3.0.0. Would this be to replace that @SInCE tag or would it be in addition to that?

UPDATE: Nevermind, I see your additional comments about it.

@jonwaldstein
Copy link
Contributor

@gilbert-hernandez all good, yeah we add those @unreleased tags above the original @since tag with a brief message describing what has been changed. Then when releasing, those @unreleased tags get replaced with the actual release version.

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