This commit is contained in:
hypercross 2026-03-22 00:27:59 +08:00
parent 68d57ac049
commit 4839985154
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import type { MarkedExtension, Tokens } from "marked";
function tableToCSV(headers: string[], rows: string[][]): string { function tableToCSV(headers: string[], rows: string[][]): string {
const escapeCell = (cell: string) => { const escapeCell = (cell: string) => {
// 如果单元格包含逗号、换行或引号,需要转义 // 如果单元格包含逗号、换行或引号,需要转义
if (cell.includes(',') || cell.includes('\n') || cell.includes('"')) { if (cell.includes(',') || cell.includes('\n') || cell.includes('"') || cell.includes("#")) {
return `"${cell.replace(/"/g, '""')}"`; return `"${cell.replace(/"/g, '""')}"`;
} }
return cell; return cell;