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

lizhimins pushed a commit to branch rocketmq-studio
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git


The following commit(s) were added to refs/heads/rocketmq-studio by this push:
     new 27e83710 fix(topic): guard control-prefixed CSV formulas (#1559)
27e83710 is described below

commit 27e837108f59dc2adc92b28415f13f6fdb1ef001
Author: 0 <[email protected]>
AuthorDate: Tue Aug 11 20:23:18 2026 +0800

    fix(topic): guard control-prefixed CSV formulas (#1559)
---
 web/src/pages/instance/__tests__/TopicPage.test.tsx | 4 ++--
 web/src/pages/instance/topic.tsx                    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/web/src/pages/instance/__tests__/TopicPage.test.tsx 
b/web/src/pages/instance/__tests__/TopicPage.test.tsx
index 6e70fcd8..0750eeb3 100644
--- a/web/src/pages/instance/__tests__/TopicPage.test.tsx
+++ b/web/src/pages/instance/__tests__/TopicPage.test.tsx
@@ -167,7 +167,7 @@ describe('TopicPage', () => {
         ...buildTopics(1)[0],
         name: 'orders-topic',
         namespace: 'trade',
-        remark: 'orders, "critical"',
+        remark: '\t=orders, "critical"',
       },
       {
         ...buildTopics(1)[0],
@@ -192,7 +192,7 @@ describe('TopicPage', () => {
     expect(exportedBlob).toBeDefined();
     const csv = await exportedBlob!.text();
     expect(csv).toContain('"orders-topic"');
-    expect(csv).toContain('"orders, ""critical"""');
+    expect(csv).toContain('"\'\t=orders, ""critical"""');
     expect(csv).not.toContain('users-topic');
     clickSpy.mockRestore();
   });
diff --git a/web/src/pages/instance/topic.tsx b/web/src/pages/instance/topic.tsx
index 20411237..b66267bd 100644
--- a/web/src/pages/instance/topic.tsx
+++ b/web/src/pages/instance/topic.tsx
@@ -110,7 +110,7 @@ const TOPIC_EXPORT_COLUMNS: Array<{ header: string; value: 
(topic: Topic) => unk
 
 const escapeCsvCell = (value: unknown) => {
   const text = value == null ? '' : String(value);
-  const formulaSafeText = /^[=+\-@]/.test(text) ? `'${text}` : text;
+  const formulaSafeText = /^[=+\-@\t\r\n]/.test(text) ? `'${text}` : text;
   return `"${formulaSafeText.replace(/"/g, '""')}"`;
 };
 

Reply via email to