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/07 15:55:45 UTC
(superset) branch master updated: test(superset-ui-core): prove angle-bracketed non-HTML values render as text (#34082) (#41829)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new a01a4ae511e test(superset-ui-core): prove angle-bracketed non-HTML values render as text (#34082) (#41829)
a01a4ae511e is described below
commit a01a4ae511e21e8bd3feabb6e849222e9ba10050
Author: Evan Rusackas <ev...@preset.io>
AuthorDate: Tue Jul 7 08:55:39 2026 -0700
test(superset-ui-core): prove angle-bracketed non-HTML values render as text (#34082) (#41829)
Co-authored-by: Claude Code <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', () => {