Skip to content

fix(pivot-table): apply safeHtmlSpan for cells in the pivot table chart#33452

Closed
richardfogaca wants to merge 1 commit intoapache:masterfrom
richardfogaca:fix/pivot-table-td-rendering
Closed

fix(pivot-table): apply safeHtmlSpan for cells in the pivot table chart#33452
richardfogaca wants to merge 1 commit intoapache:masterfrom
richardfogaca:fix/pivot-table-td-rendering

Conversation

@richardfogaca
Copy link
Contributor

SUMMARY

The Pivot Table chart was not rendering HTML content within its cells. Instead of displaying formatted HTML (e.g., hyperlinks), it showed the raw HTML tags as plain text. This occurred even when the underlying data contained valid HTML strings and the allowRenderHtml prop was set to true.

BEFORE SCREENSHOT

Screenshot 2025-05-15 at 11 58 30

AFTER SCREENSHOT

Screenshot 2025-05-15 at 12 19 33

TESTING INSTRUCTIONS

  • This chart export can be imported into Superset to directly observe the issue. But also possible to be reproduced following the steps below:
  1. Create or import a Pivot Table chart where the dataset provides HTML content for one or more cells.
  2. Configure the chart to use these HTML-containing fields.
  3. Observe the rendering of the data cells in the pivot table. The attached chart export can be imported into Superset to directly observe the issue.

ADDITIONAL INFORMATION

  • Has associated issue: Pivot table cells not rendering html #33449
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the viz:charts:pivot Related to the Pivot Table charts label May 15, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

I've completed my review and didn't find any issues.

Files scanned
File Path Reviewed
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@rusackas
Copy link
Member

So I'm a little confused here. I see you have the "Render Columns in HTML" checkbox checked, and it looks like the cells ARE rendering HTML... but it's just not rendering certain tags (e.g. strong)?

@richardfogaca
Copy link
Contributor Author

richardfogaca commented May 15, 2025

So I'm a little confused here. I see you have the "Render Columns in HTML" checkbox checked, and it looks like the cells ARE rendering HTML... but it's just not rendering certain tags (e.g. strong)?

@rusackas Actually the cells do not render html properly, with the exception of country column (this would be a header). In the example you can see a <strong> tag not rendered and also a <em> tag, but other tags are also not rendered like <a>

@rusackas rusackas added the review:checkpoint Last PR reviewed during the daily review standup label May 15, 2025
@michael-s-molina michael-s-molina removed the review:checkpoint Last PR reviewed during the daily review standup label May 16, 2025
@rusackas
Copy link
Member

This has conflicts, and I think there was a recent PR that tackled the same topic and got merged. Converting to draft for now, but maybe this isn't needed any more?

@rusackas rusackas marked this pull request as draft August 12, 2025 20:35
@msyavuz
Copy link
Member

msyavuz commented Aug 13, 2025

Yeah, i think i fixed this with this . It looks identical to this one. We had a bit of duplicate work so sorry about that!

@msyavuz msyavuz closed this Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugins size/S viz:charts:pivot Related to the Pivot Table charts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants