You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/07/06 23:40:19 UTC

(superset) 01/01: test(superset-ui-core): prove angle-bracketed non-HTML values render as text (#34082)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch test/issue-34082-html-truncation
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 71119857dd62656c380a22e28b81eb63b2555701
Author: Claude Code <no...@anthropic.com>
AuthorDate: Mon Jul 6 16:39:48 2026 -0700

    test(superset-ui-core): prove angle-bracketed non-HTML values render as text (#34082)
    
    Co-Authored-By: Claude Fable 5 <no...@anthropic.com>
---
 .../packages/superset-ui-core/src/utils/html.test.tsx   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/superset-frontend/packages/superset-ui-core/src/utils/html.test.tsx b/superset-frontend/packages/superset-ui-core/src/utils/html.test.tsx
index 54823c1e5ce..d2928d66d0b 100644
--- a/superset-frontend/packages/superset-ui-core/src/utils/html.test.tsx
+++ b/superset-frontend/packages/superset-ui-core/src/utils/html.test.tsx
@@ -95,6 +95,17 @@ describe('isProbablyHTML', () => {
     expect(isProbablyHTML('price < $100')).toBe(false);
   });
 
+  test('should return false for angle-bracketed data values (issue #34082)', () => {
+    // MySQL column values wrapped in angle brackets must not be treated as
+    // HTML, otherwise they get swallowed and appear truncated in SQL Lab
+    // and Table chart results
+    expect(isProbablyHTML('<Buddhist Blue Duck-No Giblets>')).toBe(false);
+    expect(isProbablyHTML('<Roasted Chicken-Whole>')).toBe(false);
+    expect(
+      isProbablyHTML('prefix <Buddhist Blue Duck-No Giblets> suffix'),
+    ).toBe(false);
+  });
+
   test('should return true for all known HTML tags', () => {
     expect(isProbablyHTML('<section>Content</section>')).toBe(true);
     expect(isProbablyHTML('<article>Content</article>')).toBe(true);
@@ -146,6 +157,12 @@ describe('safeHtmlSpan', () => {
     const result = safeHtmlSpan(plainText);
     expect(result).toEqual(plainText);
   });
+
+  test('should return angle-bracketed data values untouched (issue #34082)', () => {
+    const dataValue = '<Buddhist Blue Duck-No Giblets>';
+    expect(safeHtmlSpan(dataValue)).toBe(dataValue);
+    expect(sanitizeHtmlIfNeeded(dataValue)).toBe(dataValue);
+  });
 });
 
 describe('removeHTMLTags', () => {