kordoc 4.25.20 → 4.25.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +2 -2
  2. package/dist/{chunk-NJ4XKLJ2.js → chunk-24LB25LZ.js} +2 -2
  3. package/dist/{chunk-2PG66APB.js → chunk-3AYNFK6J.js} +2 -2
  4. package/dist/{chunk-3PP4Z3FP.js → chunk-5MDRUEHP.js} +3 -3
  5. package/dist/{chunk-BADCOPJC.js → chunk-5ULHNZ3P.js} +3 -3
  6. package/dist/{chunk-Y5SKJKIK.js → chunk-6I3X54AQ.js} +2 -2
  7. package/dist/{chunk-XPCPNLPL.js → chunk-6MCJHRSM.js} +2 -2
  8. package/dist/{chunk-LWH2LXGF.js → chunk-COJYQKGH.js} +6 -4
  9. package/dist/{chunk-LWH2LXGF.js.map → chunk-COJYQKGH.js.map} +2 -2
  10. package/dist/{chunk-SXCZLQWK.js → chunk-DHXKCDAU.js} +50 -6
  11. package/dist/chunk-DHXKCDAU.js.map +7 -0
  12. package/dist/{chunk-3VFPOZUF.js → chunk-DZOA5N5W.js} +2 -2
  13. package/dist/{chunk-C23CZCN2.js → chunk-FDSFXE2L.js} +2 -2
  14. package/dist/{chunk-JOVWROSN.js → chunk-GJORKM42.js} +2 -2
  15. package/dist/{chunk-53HOCVFW.js → chunk-HQILGS2O.js} +2 -2
  16. package/dist/{chunk-YL5NXWPG.js → chunk-KW4JO5CV.js} +3 -3
  17. package/dist/{chunk-YAJUYPG6.js → chunk-LSUTK3DH.js} +2 -2
  18. package/dist/{chunk-74PQK4BH.js → chunk-MWCJYIJC.js} +19 -19
  19. package/dist/{chunk-Q2IBOGTT.js → chunk-PFNZQ3XI.js} +2 -2
  20. package/dist/{chunk-OJL2KWEP.js → chunk-PVOLFVXE.js} +2 -2
  21. package/dist/{chunk-N4G253GI.js → chunk-QNJ2LMUO.js} +8 -8
  22. package/dist/{chunk-4AHUE7MM.js → chunk-QOCUFTT4.js} +4 -4
  23. package/dist/{chunk-FL3O63DT.js → chunk-S553BW45.js} +6 -6
  24. package/dist/{chunk-2RRYYIDJ.js → chunk-TI6S3KZF.js} +2 -2
  25. package/dist/{chunk-W24M3GRV.js → chunk-TYJSNW4Z.js} +55 -46
  26. package/dist/chunk-TYJSNW4Z.js.map +7 -0
  27. package/dist/{chunk-CCJ66IWE.js → chunk-W5AHXAUP.js} +6 -6
  28. package/dist/{chunk-P74JR5PT.js → chunk-XUBBFY3H.js} +5 -5
  29. package/dist/{chunk-YKPC2V2D.js → chunk-ZCMMU34Z.js} +2 -2
  30. package/dist/{chunk-4JIM5KIE.js → chunk-ZO4P735U.js} +2 -2
  31. package/dist/chunks-XX7RHVQF.js +10 -0
  32. package/dist/cli.js +37 -37
  33. package/dist/{formula-ZLRIPWXH.js → formula-HMKT4BZL.js} +4 -4
  34. package/dist/{generator-TQUJJGL2.js → generator-HOY4SZ26.js} +7 -7
  35. package/dist/{hancom-ET5G25Y3.js → hancom-QWJBWOOE.js} +2 -2
  36. package/dist/{image-ocr-PINHNXEM.js → image-ocr-P5AIZNT3.js} +11 -11
  37. package/dist/index.cjs +86 -36
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.js +21 -21
  40. package/dist/mcp.js +33 -33
  41. package/dist/memo-Q7772VJD.js +15 -0
  42. package/dist/{model-bundle-PHN7MCDR.js → model-bundle-5CXCIZHZ.js} +5 -5
  43. package/dist/{models-RVXHUSO6.js → models-PS4L7NLP.js} +5 -5
  44. package/dist/{page-images-V3NUHVIE.js → page-images-QW7IUTUB.js} +2 -2
  45. package/dist/{parse-worker-v2-N5GNR2M4.js → parse-worker-v2-PRH6KVKP.js} +23 -23
  46. package/dist/{parser-HJXLKIQJ.js → parser-OQIR5ZMI.js} +14 -14
  47. package/dist/{pdf-ocr-OCXKEJL7.js → pdf-ocr-ZH4JAUTR.js} +9 -9
  48. package/dist/{profile-io-DTAP26A4.js → profile-io-JFRAM2VE.js} +3 -3
  49. package/dist/{rasterize-UNT2CNKR.js → rasterize-JJOMUTYX.js} +3 -3
  50. package/dist/{redact-doc-D76ULHWT.js → redact-doc-A7TW4MNF.js} +22 -22
  51. package/dist/{render-D26TXZMX.js → render-VAOMAQV2.js} +10 -10
  52. package/dist/{rewrite-fallback-MP7LAJCW.js → rewrite-fallback-7PR7V3AZ.js} +12 -12
  53. package/dist/seal-RZZNRJFL.js +14 -0
  54. package/dist/{setup-3AEQJP6V.js → setup-6DXZJQCT.js} +3 -3
  55. package/dist/{to-hwpx-MNDLBCGC.js → to-hwpx-A56R6H27.js} +7 -7
  56. package/dist/visual-25RY7EFI.js +42 -0
  57. package/dist/{watch-2IVEGZ7U.js → watch-7W6CKGX7.js} +22 -22
  58. package/package.json +1 -1
  59. package/dist/chunk-SXCZLQWK.js.map +0 -7
  60. package/dist/chunk-W24M3GRV.js.map +0 -7
  61. package/dist/chunks-DDSN3VYT.js +0 -10
  62. package/dist/memo-JGUOC4ZP.js +0 -15
  63. package/dist/seal-OOIIF2IN.js +0 -14
  64. package/dist/visual-QQVRZNCA.js +0 -42
  65. /package/dist/{chunk-NJ4XKLJ2.js.map → chunk-24LB25LZ.js.map} +0 -0
  66. /package/dist/{chunk-2PG66APB.js.map → chunk-3AYNFK6J.js.map} +0 -0
  67. /package/dist/{chunk-3PP4Z3FP.js.map → chunk-5MDRUEHP.js.map} +0 -0
  68. /package/dist/{chunk-BADCOPJC.js.map → chunk-5ULHNZ3P.js.map} +0 -0
  69. /package/dist/{chunk-Y5SKJKIK.js.map → chunk-6I3X54AQ.js.map} +0 -0
  70. /package/dist/{chunk-XPCPNLPL.js.map → chunk-6MCJHRSM.js.map} +0 -0
  71. /package/dist/{chunk-3VFPOZUF.js.map → chunk-DZOA5N5W.js.map} +0 -0
  72. /package/dist/{chunk-C23CZCN2.js.map → chunk-FDSFXE2L.js.map} +0 -0
  73. /package/dist/{chunk-JOVWROSN.js.map → chunk-GJORKM42.js.map} +0 -0
  74. /package/dist/{chunk-53HOCVFW.js.map → chunk-HQILGS2O.js.map} +0 -0
  75. /package/dist/{chunk-YL5NXWPG.js.map → chunk-KW4JO5CV.js.map} +0 -0
  76. /package/dist/{chunk-YAJUYPG6.js.map → chunk-LSUTK3DH.js.map} +0 -0
  77. /package/dist/{chunk-74PQK4BH.js.map → chunk-MWCJYIJC.js.map} +0 -0
  78. /package/dist/{chunk-Q2IBOGTT.js.map → chunk-PFNZQ3XI.js.map} +0 -0
  79. /package/dist/{chunk-OJL2KWEP.js.map → chunk-PVOLFVXE.js.map} +0 -0
  80. /package/dist/{chunk-N4G253GI.js.map → chunk-QNJ2LMUO.js.map} +0 -0
  81. /package/dist/{chunk-4AHUE7MM.js.map → chunk-QOCUFTT4.js.map} +0 -0
  82. /package/dist/{chunk-FL3O63DT.js.map → chunk-S553BW45.js.map} +0 -0
  83. /package/dist/{chunk-2RRYYIDJ.js.map → chunk-TI6S3KZF.js.map} +0 -0
  84. /package/dist/{chunk-CCJ66IWE.js.map → chunk-W5AHXAUP.js.map} +0 -0
  85. /package/dist/{chunk-P74JR5PT.js.map → chunk-XUBBFY3H.js.map} +0 -0
  86. /package/dist/{chunk-YKPC2V2D.js.map → chunk-ZCMMU34Z.js.map} +0 -0
  87. /package/dist/{chunk-4JIM5KIE.js.map → chunk-ZO4P735U.js.map} +0 -0
  88. /package/dist/{chunks-DDSN3VYT.js.map → chunks-XX7RHVQF.js.map} +0 -0
  89. /package/dist/{formula-ZLRIPWXH.js.map → formula-HMKT4BZL.js.map} +0 -0
  90. /package/dist/{generator-TQUJJGL2.js.map → generator-HOY4SZ26.js.map} +0 -0
  91. /package/dist/{hancom-ET5G25Y3.js.map → hancom-QWJBWOOE.js.map} +0 -0
  92. /package/dist/{image-ocr-PINHNXEM.js.map → image-ocr-P5AIZNT3.js.map} +0 -0
  93. /package/dist/{memo-JGUOC4ZP.js.map → memo-Q7772VJD.js.map} +0 -0
  94. /package/dist/{model-bundle-PHN7MCDR.js.map → model-bundle-5CXCIZHZ.js.map} +0 -0
  95. /package/dist/{models-RVXHUSO6.js.map → models-PS4L7NLP.js.map} +0 -0
  96. /package/dist/{page-images-V3NUHVIE.js.map → page-images-QW7IUTUB.js.map} +0 -0
  97. /package/dist/{parse-worker-v2-N5GNR2M4.js.map → parse-worker-v2-PRH6KVKP.js.map} +0 -0
  98. /package/dist/{parser-HJXLKIQJ.js.map → parser-OQIR5ZMI.js.map} +0 -0
  99. /package/dist/{pdf-ocr-OCXKEJL7.js.map → pdf-ocr-ZH4JAUTR.js.map} +0 -0
  100. /package/dist/{profile-io-DTAP26A4.js.map → profile-io-JFRAM2VE.js.map} +0 -0
  101. /package/dist/{rasterize-UNT2CNKR.js.map → rasterize-JJOMUTYX.js.map} +0 -0
  102. /package/dist/{redact-doc-D76ULHWT.js.map → redact-doc-A7TW4MNF.js.map} +0 -0
  103. /package/dist/{render-D26TXZMX.js.map → render-VAOMAQV2.js.map} +0 -0
  104. /package/dist/{rewrite-fallback-MP7LAJCW.js.map → rewrite-fallback-7PR7V3AZ.js.map} +0 -0
  105. /package/dist/{seal-OOIIF2IN.js.map → seal-RZZNRJFL.js.map} +0 -0
  106. /package/dist/{setup-3AEQJP6V.js.map → setup-6DXZJQCT.js.map} +0 -0
  107. /package/dist/{to-hwpx-MNDLBCGC.js.map → to-hwpx-A56R6H27.js.map} +0 -0
  108. /package/dist/{visual-QQVRZNCA.js.map → visual-25RY7EFI.js.map} +0 -0
  109. /package/dist/{watch-2IVEGZ7U.js.map → watch-7W6CKGX7.js.map} +0 -0
@@ -31,6 +31,7 @@ import {
31
31
  minimalTextSplices,
32
32
  noScriptTags,
33
33
  normForMatch,
34
+ noteMarksOf,
34
35
  pairTablesInGaps,
35
36
  parseEmphasis,
36
37
  parseGfmTable,
@@ -38,6 +39,7 @@ import {
38
39
  parseSectionPathsFromManifest,
39
40
  parseSectionXml,
40
41
  readKordocLayout,
42
+ removeNoteMarks,
41
43
  replicateColumnTable,
42
44
  replicateGfmTable,
43
45
  replicateHtmlTable,
@@ -45,6 +47,7 @@ import {
45
47
  resolveSectionPaths,
46
48
  restructureCellLines,
47
49
  restyledKept,
50
+ splitCellNote,
48
51
  splitMarkdownUnits,
49
52
  stripHeadMarker,
50
53
  stripShownHeadMarker,
@@ -53,17 +56,17 @@ import {
53
56
  unescapeGfm,
54
57
  unescapeGfmCell,
55
58
  wordHunks
56
- } from "./chunk-SXCZLQWK.js";
59
+ } from "./chunk-DHXKCDAU.js";
57
60
  import {
58
61
  decryptHwpxInPlace,
59
62
  lockedHwpxError,
60
63
  noteFormatFrom,
61
64
  noteRefMark
62
- } from "./chunk-BADCOPJC.js";
65
+ } from "./chunk-5ULHNZ3P.js";
63
66
  import {
64
67
  patchZipEntries,
65
68
  readZipEntries
66
- } from "./chunk-XPCPNLPL.js";
69
+ } from "./chunk-6MCJHRSM.js";
67
70
  import {
68
71
  allLinesegRemovalSplices,
69
72
  applySplices,
@@ -92,7 +95,7 @@ import {
92
95
  findChildByLocalName,
93
96
  localName,
94
97
  readZipEntry
95
- } from "./chunk-Y5SKJKIK.js";
98
+ } from "./chunk-6I3X54AQ.js";
96
99
  import {
97
100
  comResultToParseResult,
98
101
  extractTextViaCom,
@@ -107,7 +110,7 @@ import {
107
110
  locateMemoBlocks,
108
111
  parseHwp5Document,
109
112
  unfilledClickHereGuide
110
- } from "./chunk-P74JR5PT.js";
113
+ } from "./chunk-XUBBFY3H.js";
111
114
  import {
112
115
  FLAG_COMPRESSED,
113
116
  FLAG_DISTRIBUTION,
@@ -128,7 +131,7 @@ import {
128
131
  isExtendedOnlyCtrlChar,
129
132
  parseFileHeader,
130
133
  readRecords
131
- } from "./chunk-YAJUYPG6.js";
134
+ } from "./chunk-LSUTK3DH.js";
132
135
  import {
133
136
  parsePageRange
134
137
  } from "./chunk-Y56TLZ42.js";
@@ -140,20 +143,20 @@ import {
140
143
  } from "./chunk-L3U4XTBO.js";
141
144
  import {
142
145
  unframeLayoutTables
143
- } from "./chunk-JOVWROSN.js";
146
+ } from "./chunk-GJORKM42.js";
144
147
  import {
145
148
  blocksToMarkdown,
146
149
  escapeGfm,
147
150
  hasInlineCellBlocks,
148
151
  sanitizeText
149
- } from "./chunk-2PG66APB.js";
152
+ } from "./chunk-3AYNFK6J.js";
150
153
  import {
151
154
  KordocError,
152
155
  compareSectionPaths,
153
156
  isPathTraversal,
154
157
  precheckZipSize,
155
158
  stripDtd
156
- } from "./chunk-NJ4XKLJ2.js";
159
+ } from "./chunk-24LB25LZ.js";
157
160
 
158
161
  // src/hwpx/parser.ts
159
162
  import JSZip2 from "jszip";
@@ -1381,9 +1384,16 @@ function applyCellEdit(table, scanTable, gridR, gridC, newLines, ctx, before, af
1381
1384
  };
1382
1385
  const cell = scanTable.cellByAnchor.get(`${gridR},${gridC}`);
1383
1386
  if (!cell) return skip("셀 좌표 매핑 실패 (병합 영역의 빈 칸이거나 좌표 불일치)");
1387
+ const origLines = gfmCellLines(before);
1388
+ if (origLines.some((l) => /\(주: [\s\S]*\)$/.test(l)) && origLines.length === newLines.length) {
1389
+ const notes = newLines.map((l, i) => splitCellNote(origLines[i], l, ctx.skipped));
1390
+ newLines = notes.map((n) => n.after);
1391
+ before = notes.map((n) => n.before).join("<br>");
1392
+ }
1384
1393
  const irCell = table.cells[gridR]?.[gridC];
1385
1394
  const scanJoined = cell.paragraphs.map((p) => p.text).filter((t) => normForMatch(t)).join("\n");
1386
- if (irCell && normForMatch(scanJoined) !== normForMatch(noScriptTags(stripCellTokens(irCell.text)))) {
1395
+ const noteless = (text) => text.split("\n").map((l) => splitCellNote(l, l, []).before).join("\n");
1396
+ if (irCell && normForMatch(scanJoined) !== normForMatch(noteless(noScriptTags(stripCellTokens(irCell.text))))) {
1387
1397
  if (normForMatch(irCell.text) !== "" || normForMatch(scanJoined) !== "") {
1388
1398
  const flatBlocks = (irCell.blocks ?? []).filter((b) => b.type === "paragraph" || b.type === "heading");
1389
1399
  const flatJoined = noScriptTags(flatBlocks.map((b) => b.text ?? "").join("\n"));
@@ -2198,29 +2208,6 @@ function textWithoutMarks(irKey, scanKey, marks) {
2198
2208
  }
2199
2209
  return j === scanKey.length && k === marks.length;
2200
2210
  }
2201
- function removeNoteMarks(text, marks) {
2202
- let out = text;
2203
- let cursor = 0;
2204
- const missing = [];
2205
- for (const mark of marks) {
2206
- if (!mark) continue;
2207
- let at = -1;
2208
- for (let p = out.indexOf(mark, cursor); p !== -1; p = out.indexOf(mark, p + 1)) {
2209
- if (p === 0 || !/\s/.test(out[p - 1])) {
2210
- at = p;
2211
- break;
2212
- }
2213
- if (at === -1) at = p;
2214
- }
2215
- if (at === -1) {
2216
- missing.push(mark);
2217
- continue;
2218
- }
2219
- out = out.slice(0, at) + out.slice(at + mark.length);
2220
- cursor = at;
2221
- }
2222
- return { text: out, missing };
2223
- }
2224
2211
  function fallbackPlain(raw, block) {
2225
2212
  const inline = block ? textUnitInline(raw, block, "\n") : raw.split("\n").map((l) => l.trim()).filter(Boolean).join("\n");
2226
2213
  return parseEmphasis(inline.replace(/!\[[^\]]*\]\([^)]*\)/g, " ").replace(/<br\s*\/?>/gi, "\n")).plain.replace(/<\/?(?:sup|sub)>/g, "");
@@ -2364,6 +2351,7 @@ function patchParagraphUnit(block, orig, edited, ctx, skip) {
2364
2351
  let origPlain = origInline.plain;
2365
2352
  let newPlain = newInline.plain;
2366
2353
  const segsUsable = !block.footnoteText && !mapping.noteMarks?.length && !mapping.prefixStripped;
2354
+ let noteEdited = false;
2367
2355
  if (block.footnoteText) {
2368
2356
  const origNote = block.footnoteBlocks ? origPlain.match(/\s*\(주: ([\s\S]*)\)$/)?.[1] : void 0;
2369
2357
  origPlain = origPlain.replace(/\s*\(주: [\s\S]*\)$/, "");
@@ -2372,6 +2360,7 @@ function patchParagraphUnit(block, orig, edited, ctx, skip) {
2372
2360
  newPlain = newPlain.slice(0, noteMatch.index).trimEnd();
2373
2361
  if (normForMatch(noteMatch[1]) !== normForMatch(origNote ?? block.footnoteText)) {
2374
2362
  ctx.skipped.push({ reason: "각주 텍스트 수정은 미지원 — 본문만 적용", before: block.footnoteText, after: noteMatch[1] });
2363
+ noteEdited = true;
2375
2364
  }
2376
2365
  } else {
2377
2366
  ctx.skipped.push({ reason: "각주 표기 삭제는 미지원 — 각주 유지, 본문만 적용", before: `(주: ${block.footnoteText})` });
@@ -2389,7 +2378,7 @@ function patchParagraphUnit(block, orig, edited, ctx, skip) {
2389
2378
  newPlain = head.text;
2390
2379
  if (head.note) ctx.skipped.push({ reason: head.note, after: summarize(newPlain), partial: true });
2391
2380
  }
2392
- if (newPlain === origPlain) return skip("텍스트 외 변경(헤딩 레벨/서식)만 감지 — 스타일 변경은 미지원");
2381
+ if (newPlain === origPlain) return noteEdited ? 0 : skip("텍스트 외 변경(헤딩 레벨/서식)만 감지 — 스타일 변경은 미지원");
2393
2382
  if (sanitizeText(newPlain) !== newPlain && sanitizeText(origPlain) === origPlain) {
2394
2383
  return skip("공백 정규화 불안정 텍스트 — 패치 시 원문 보존 불가로 미지원");
2395
2384
  }
@@ -3710,6 +3699,7 @@ function resolveParaMappings(blocks, scans) {
3710
3699
  const text = noScriptTags(b.text);
3711
3700
  let key2 = normForMatch(text);
3712
3701
  let prefixStripped = false;
3702
+ let noteMarks;
3713
3703
  if (!buckets.has(key2)) {
3714
3704
  const sp = text.indexOf(" ");
3715
3705
  if (sp > 0) {
@@ -3720,6 +3710,15 @@ function resolveParaMappings(blocks, scans) {
3720
3710
  }
3721
3711
  }
3722
3712
  }
3713
+ const marks = noteMarksOf(b.footnoteText);
3714
+ if (!buckets.has(key2) && marks.length) {
3715
+ const r = removeNoteMarks(text, marks);
3716
+ const alt = r.missing.length ? "" : normForMatch(r.text);
3717
+ if (alt && buckets.has(alt)) {
3718
+ key2 = alt;
3719
+ noteMarks = marks;
3720
+ }
3721
+ }
3723
3722
  const found = buckets.get(key2);
3724
3723
  const list = found ? pairable(key2, found) : null;
3725
3724
  if (!list) {
@@ -3728,7 +3727,7 @@ function resolveParaMappings(blocks, scans) {
3728
3727
  }
3729
3728
  const occ = counters.get(key2) ?? 0;
3730
3729
  counters.set(key2, occ + 1);
3731
- result.set(i, occ < list.length ? { para: list[occ], prefixStripped } : {});
3730
+ result.set(i, occ < list.length ? { para: list[occ], prefixStripped, noteMarks } : {});
3732
3731
  }
3733
3732
  return result;
3734
3733
  }
@@ -3885,29 +3884,38 @@ function patchParagraph(block, orig, edited, ctx, skip) {
3885
3884
  if (block.text && block.text.includes("\n") && !newPlain.includes("\n")) {
3886
3885
  return skip("다중줄 문단 수정에 <br> 없음 — 줄바꿈 위치 보존 불가로 미지원 (줄바꿈은 <br>로 표기)");
3887
3886
  }
3887
+ let noteEdited = false;
3888
3888
  if (block.footnoteText) {
3889
3889
  const noteMatch = newPlain.match(/\s*\(주: ([\s\S]*)\)$/);
3890
3890
  if (noteMatch) {
3891
3891
  newPlain = newPlain.slice(0, noteMatch.index).trimEnd();
3892
3892
  if (normForMatch(noteMatch[1]) !== normForMatch(block.footnoteText)) {
3893
3893
  ctx.skipped.push({ reason: "각주 텍스트 수정은 미지원 — 본문만 적용", before: block.footnoteText, after: noteMatch[1] });
3894
+ noteEdited = true;
3894
3895
  }
3895
3896
  } else {
3896
3897
  ctx.skipped.push({ reason: "각주 표기 삭제는 미지원 — 각주 유지, 본문만 적용", before: `(주: ${block.footnoteText})` });
3897
3898
  }
3898
3899
  }
3900
+ if (mapping.noteMarks?.length) {
3901
+ const r = removeNoteMarks(newPlain, mapping.noteMarks);
3902
+ newPlain = r.text;
3903
+ if (r.missing.length) ctx.skipped.push({ reason: "각주 참조 부호 삭제는 미지원 — 각주 유지, 본문만 적용", before: r.missing.join(" ") });
3904
+ }
3899
3905
  if (mapping.prefixStripped) {
3900
3906
  const head = stripHeadMarker(block.text, newPlain);
3901
3907
  newPlain = head.text;
3902
3908
  if (head.note) ctx.skipped.push({ reason: head.note, after: summarize(newPlain), partial: true });
3903
3909
  }
3904
- const origPlain = block.text != null ? noScriptTags(block.text) : restoreBr(origStyled.plain);
3905
- if (newPlain === origPlain) return skip("텍스트 외 변경(헤딩 레벨/서식)만 감지 — 스타일 변경은 미지원");
3910
+ let origPlain = block.text != null ? noScriptTags(block.text) : restoreBr(origStyled.plain);
3911
+ if (mapping.noteMarks?.length) origPlain = removeNoteMarks(origPlain, mapping.noteMarks).text;
3912
+ if (newPlain === origPlain) return noteEdited ? 0 : skip("텍스트 외 변경(헤딩 레벨/서식)만 감지 — 스타일 변경은 미지원");
3906
3913
  if (sanitizeText(newPlain) !== newPlain && sanitizeText(origPlain) === origPlain) {
3907
3914
  return skip("공백 정규화 불안정 텍스트 — 패치 시 원문 보존 불가로 미지원");
3908
3915
  }
3909
3916
  let origMd = restoreBr(origStyled.plain);
3910
3917
  if (block.footnoteText) origMd = origMd.replace(/\s*\(주: [\s\S]*\)$/, "");
3918
+ if (mapping.noteMarks?.length) origMd = removeNoteMarks(origMd, mapping.noteMarks).text;
3911
3919
  if (mapping.prefixStripped) origMd = stripShownHeadMarker(block.text, origMd);
3912
3920
  const off = editedStyled.plain.length - newPlain.length;
3913
3921
  const style = ctx.charBook && off >= 0 && editedStyled.plain.endsWith(newPlain) && origStyled.plain.endsWith(origMd) ? { flags: flagsPerChar(editedStyled.segs, editedStyled.flags).slice(off), known: origStyled.flags.reduce((a, b) => a | b, 0), book: ctx.charBook } : void 0;
@@ -3945,8 +3953,8 @@ function patchGfmCells(scanTable, orig, edited, ctx, skip) {
3945
3953
  cellSkip("서식/링크/이미지 포함 셀 수정은 미지원 (v1)");
3946
3954
  continue;
3947
3955
  }
3948
- const before = beforeEach.join("\n");
3949
- const after = afterEach.join("\n");
3956
+ if (beforeEach.join("\n") === afterEach.join("\n")) continue;
3957
+ const { before, after, noted } = splitCellNote(beforeEach.join("\n"), afterEach.join("\n"), ctx.skipped);
3950
3958
  if (before === after) continue;
3951
3959
  const para = cell.paras[0];
3952
3960
  if (normForMatch(para.rawText) !== normForMatch(before)) {
@@ -3965,7 +3973,7 @@ function patchGfmCells(scanTable, orig, edited, ctx, skip) {
3965
3973
  ctx.keepLineseg,
3966
3974
  before,
3967
3975
  // 바뀐 자리만 — 굵은 조각 등 run 유지
3968
- cellLineStyles(origRows[r][c], editedRows[r][c], ctx.charBook)(0, after)
3976
+ noted ? void 0 : cellLineStyles(origRows[r][c], editedRows[r][c], ctx.charBook)(0, after)
3969
3977
  );
3970
3978
  continue;
3971
3979
  }
@@ -3974,12 +3982,14 @@ function patchGfmCells(scanTable, orig, edited, ctx, skip) {
3974
3982
  continue;
3975
3983
  }
3976
3984
  for (let k = 0; k < cell.paras.length; k++) {
3977
- const before = gfmCellToPlain(beforeParts[k]);
3978
- const after = gfmCellToPlain(afterParts[k]);
3979
- if (before === null || after === null) {
3985
+ const rawBefore = gfmCellToPlain(beforeParts[k]);
3986
+ const rawAfter = gfmCellToPlain(afterParts[k]);
3987
+ if (rawBefore === null || rawAfter === null) {
3980
3988
  cellSkip("서식/링크/이미지 포함 셀 수정은 미지원 (v1)");
3981
3989
  break;
3982
3990
  }
3991
+ if (rawBefore === rawAfter) continue;
3992
+ const { before, after, noted } = splitCellNote(rawBefore, rawAfter, ctx.skipped);
3983
3993
  if (before === after) continue;
3984
3994
  if (after.includes("\n")) {
3985
3995
  cellSkip("셀 내 줄바꿈 추가는 미지원 (v1)");
@@ -4002,7 +4012,7 @@ function patchGfmCells(scanTable, orig, edited, ctx, skip) {
4002
4012
  ctx.keepLineseg,
4003
4013
  before,
4004
4014
  // 바뀐 자리만 — 굵은 조각 등 run 유지
4005
- cellLineStyles(origRows[r][c], editedRows[r][c], ctx.charBook)(k, after)
4015
+ noted ? void 0 : cellLineStyles(origRows[r][c], editedRows[r][c], ctx.charBook)(k, after)
4006
4016
  );
4007
4017
  }
4008
4018
  }
@@ -4213,7 +4223,6 @@ export {
4213
4223
  buildOrigUnits,
4214
4224
  buildTableOrdinals,
4215
4225
  resolveParagraphMappings,
4216
- removeNoteMarks,
4217
4226
  diffUnitLists
4218
4227
  };
4219
- //# sourceMappingURL=chunk-W24M3GRV.js.map
4228
+ //# sourceMappingURL=chunk-TYJSNW4Z.js.map