diff --git a/A00_Common/spreadsheet/spreadsheet_clipboard.ts b/A00_Common/spreadsheet/spreadsheet_clipboard.ts index 2c03858b..06c25067 100644 --- a/A00_Common/spreadsheet/spreadsheet_clipboard.ts +++ b/A00_Common/spreadsheet/spreadsheet_clipboard.ts @@ -219,10 +219,17 @@ function walkTable(table: HTMLTableElement): TableWalk { return { rows: rows.length, cols, owner, merges }; } +/** 선언 나눔 — `mso-number-format:"...\;..."` 안 이스케이프된 `\;`(구역 나눔 자리표시)는 진짜 + * 선언 끝이 아님(엑셀 회계 형식처럼 구역이 여럿인 값을 여기서 잘라 버리면 값 끝에 떨어진 `\` 만 + * 남아 형식이 깨짐) — `\` 뒤 글자는 통째로 건너뛰어 그 안 `;` 는 안 자름. */ +function splitDecls(s: string): string[] { + return s.split(/(? { const out: Record = {}; - for (const decl of styleAttr.split(";")) { + for (const decl of splitDecls(styleAttr)) { const i = decl.indexOf(":"); if (i < 0) continue; const key = decl.slice(0, i).trim().toLowerCase(); diff --git a/resources/tester/spreadsheet/fixture_excel_accounting_fmt.html b/resources/tester/spreadsheet/fixture_excel_accounting_fmt.html new file mode 100644 index 00000000..a186afc3 --- /dev/null +++ b/resources/tester/spreadsheet/fixture_excel_accounting_fmt.html @@ -0,0 +1,24 @@ + + + + + + + + + + +
1234.5
+ +