kordoc 4.18.6 → 4.18.8
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.
- package/dist/{-DE2KWCGY.js → -TBEYOUTF.js} +11 -11
- package/dist/{chunk-LW5SNBU7.js → chunk-2UDRHJEC.js} +2 -2
- package/dist/{chunk-3KLL62JC.js → chunk-3EUEOJJF.js} +2 -2
- package/dist/{chunk-BY7UEIZH.js → chunk-4Y3EZHTK.js} +3 -3
- package/dist/{chunk-OWKGNWRS.js → chunk-7OFYBGLQ.js} +90 -11
- package/dist/chunk-7OFYBGLQ.js.map +1 -0
- package/dist/{chunk-7P2JOHWA.js → chunk-7ZXT2OEV.js} +3 -3
- package/dist/chunk-7ZXT2OEV.js.map +1 -0
- package/dist/{chunk-TOHCMCDL.js → chunk-DKVYQ2UN.js} +2 -2
- package/dist/{chunk-5TUGAXAI.cjs → chunk-FC26M34O.cjs} +7 -7
- package/dist/{chunk-5TUGAXAI.cjs.map → chunk-FC26M34O.cjs.map} +1 -1
- package/dist/{chunk-6N5TBPPV.js → chunk-H55E7T7E.js} +2 -2
- package/dist/{chunk-FVF57U3O.js → chunk-H5PSOZD2.js} +3 -3
- package/dist/{chunk-FVF57U3O.js.map → chunk-H5PSOZD2.js.map} +1 -1
- package/dist/{chunk-DVLKNRAA.js → chunk-ILFTSNAB.js} +2 -2
- package/dist/{chunk-QND3QFIX.js → chunk-ISL2ZW7T.js} +2 -2
- package/dist/{chunk-I5RRAR64.js → chunk-JAFG3W6G.js} +4 -4
- package/dist/{chunk-NM6WGVOR.js → chunk-LU7AVESZ.js} +2 -2
- package/dist/{chunk-FJI44TS5.cjs → chunk-LXYCBD2K.cjs} +3 -3
- package/dist/{chunk-FJI44TS5.cjs.map → chunk-LXYCBD2K.cjs.map} +1 -1
- package/dist/{chunk-SYWZ3SRQ.js → chunk-MECBEB7S.js} +3 -3
- package/dist/{chunk-4DVAKBXW.js → chunk-MMZKVUL4.js} +2 -2
- package/dist/{chunk-4JMV3G4Y.cjs → chunk-MXBO6HN2.cjs} +12 -12
- package/dist/{chunk-4JMV3G4Y.cjs.map → chunk-MXBO6HN2.cjs.map} +1 -1
- package/dist/{chunk-JYX46LZT.js → chunk-NB7INS65.js} +3 -3
- package/dist/{chunk-UUK2TZQ2.cjs → chunk-OBRXCRG3.cjs} +3 -3
- package/dist/{chunk-UUK2TZQ2.cjs.map → chunk-OBRXCRG3.cjs.map} +1 -1
- package/dist/{chunk-CWJJTCCH.js → chunk-OLW6GRNW.js} +2 -2
- package/dist/{chunk-GJJVMC2G.js → chunk-PDL6U6AF.js} +2 -2
- package/dist/{chunk-PFXSGQNN.js → chunk-RO3ALEGE.js} +2 -2
- package/dist/{chunk-UIPMCOHH.cjs → chunk-SE3MI5UX.cjs} +2 -2
- package/dist/{chunk-UIPMCOHH.cjs.map → chunk-SE3MI5UX.cjs.map} +1 -1
- package/dist/{chunk-IW2WVEZU.js → chunk-SO5S46KH.js} +2 -2
- package/dist/{chunk-PMPAREFJ.js → chunk-TNCW3J6S.js} +6 -6
- package/dist/{chunk-T45W6EIA.js → chunk-UDYQ7BIC.js} +4 -4
- package/dist/{chunk-3QJPAKDQ.js → chunk-WCSLRLH6.js} +2 -2
- package/dist/{chunk-J5HIKXQF.cjs → chunk-WQH4D2KL.cjs} +22 -22
- package/dist/{chunk-J5HIKXQF.cjs.map → chunk-WQH4D2KL.cjs.map} +1 -1
- package/dist/chunks-5L22YEVJ.js +10 -0
- package/dist/cli.js +26 -26
- package/dist/{formula-XQXGM25B.js → formula-6UIPV4SA.js} +4 -4
- package/dist/{formula-P77ISY24.js → formula-IASEKD4T.js} +3 -3
- package/dist/{formula-QQZ62X3A.cjs → formula-PUBZDZF2.cjs} +9 -9
- package/dist/{formula-QQZ62X3A.cjs.map → formula-PUBZDZF2.cjs.map} +1 -1
- package/dist/{image-ocr-7FIUVJN6.js → image-ocr-67A4FOF7.js} +6 -6
- package/dist/{image-ocr-XILDGKJT.cjs → image-ocr-AG47WH2J.cjs} +15 -15
- package/dist/{image-ocr-XILDGKJT.cjs.map → image-ocr-AG47WH2J.cjs.map} +1 -1
- package/dist/{image-ocr-LCEJXRAW.js → image-ocr-Y4XQGPDY.js} +9 -9
- package/dist/index.cjs +460 -381
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +85 -6
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-SQZ3W5YY.js → model-bundle-NOZJVM3U.js} +5 -5
- package/dist/{models-JZCTRP7M.js → models-LPI23KGR.js} +5 -5
- package/dist/{parser-QHJZTPLI.cjs → parser-25AKNBZJ.cjs} +126 -126
- package/dist/{parser-QHJZTPLI.cjs.map → parser-25AKNBZJ.cjs.map} +1 -1
- package/dist/{parser-JCVDTWZK.js → parser-CX6X3TA3.js} +11 -11
- package/dist/{parser-IKKZQMTJ.js → parser-H5H2U46P.js} +8 -8
- package/dist/pdf-ocr-6SMZ52YW.js +16 -0
- package/dist/pdf-ocr-FVNHY2WG.cjs +17 -0
- package/dist/{pdf-ocr-72EYTUTO.cjs.map → pdf-ocr-FVNHY2WG.cjs.map} +1 -1
- package/dist/pdf-ocr-TLXMNTAH.js +20 -0
- package/dist/{profile-io-ZOPP3ZZF.js → profile-io-T2AT74YH.js} +3 -3
- package/dist/{rasterize-SSVBOWS7.js → rasterize-XOVABIYS.js} +3 -3
- package/dist/{redact-doc-NKOEXJLS.js → redact-doc-7AGO4IUN.js} +11 -11
- package/dist/{render-Z3UINVKW.js → render-7FBTU4AW.js} +7 -7
- package/dist/seal-XLR6S42Z.js +10 -0
- package/dist/{setup-XFGSO4EL.js → setup-XNXUNIK4.js} +3 -3
- package/dist/visual-QUXWVHOC.js +20 -0
- package/dist/{watch-OYDMGGU6.js → watch-A5SDGA7T.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-7P2JOHWA.js.map +0 -1
- package/dist/chunk-OWKGNWRS.js.map +0 -1
- package/dist/chunks-3NIK3E7X.js +0 -10
- package/dist/pdf-ocr-53LWVES4.js +0 -16
- package/dist/pdf-ocr-72EYTUTO.cjs +0 -17
- package/dist/pdf-ocr-EZGDVPJR.js +0 -20
- package/dist/seal-UVB4GNMX.js +0 -10
- package/dist/visual-WKOKF77U.js +0 -20
- /package/dist/{-DE2KWCGY.js.map → -TBEYOUTF.js.map} +0 -0
- /package/dist/{chunk-LW5SNBU7.js.map → chunk-2UDRHJEC.js.map} +0 -0
- /package/dist/{chunk-3KLL62JC.js.map → chunk-3EUEOJJF.js.map} +0 -0
- /package/dist/{chunk-BY7UEIZH.js.map → chunk-4Y3EZHTK.js.map} +0 -0
- /package/dist/{chunk-TOHCMCDL.js.map → chunk-DKVYQ2UN.js.map} +0 -0
- /package/dist/{chunk-6N5TBPPV.js.map → chunk-H55E7T7E.js.map} +0 -0
- /package/dist/{chunk-DVLKNRAA.js.map → chunk-ILFTSNAB.js.map} +0 -0
- /package/dist/{chunk-QND3QFIX.js.map → chunk-ISL2ZW7T.js.map} +0 -0
- /package/dist/{chunk-I5RRAR64.js.map → chunk-JAFG3W6G.js.map} +0 -0
- /package/dist/{chunk-NM6WGVOR.js.map → chunk-LU7AVESZ.js.map} +0 -0
- /package/dist/{chunk-SYWZ3SRQ.js.map → chunk-MECBEB7S.js.map} +0 -0
- /package/dist/{chunk-4DVAKBXW.js.map → chunk-MMZKVUL4.js.map} +0 -0
- /package/dist/{chunk-JYX46LZT.js.map → chunk-NB7INS65.js.map} +0 -0
- /package/dist/{chunk-CWJJTCCH.js.map → chunk-OLW6GRNW.js.map} +0 -0
- /package/dist/{chunk-GJJVMC2G.js.map → chunk-PDL6U6AF.js.map} +0 -0
- /package/dist/{chunk-PFXSGQNN.js.map → chunk-RO3ALEGE.js.map} +0 -0
- /package/dist/{chunk-IW2WVEZU.js.map → chunk-SO5S46KH.js.map} +0 -0
- /package/dist/{chunk-PMPAREFJ.js.map → chunk-TNCW3J6S.js.map} +0 -0
- /package/dist/{chunk-T45W6EIA.js.map → chunk-UDYQ7BIC.js.map} +0 -0
- /package/dist/{chunk-3QJPAKDQ.js.map → chunk-WCSLRLH6.js.map} +0 -0
- /package/dist/{chunks-3NIK3E7X.js.map → chunks-5L22YEVJ.js.map} +0 -0
- /package/dist/{formula-XQXGM25B.js.map → formula-6UIPV4SA.js.map} +0 -0
- /package/dist/{formula-P77ISY24.js.map → formula-IASEKD4T.js.map} +0 -0
- /package/dist/{image-ocr-7FIUVJN6.js.map → image-ocr-67A4FOF7.js.map} +0 -0
- /package/dist/{image-ocr-LCEJXRAW.js.map → image-ocr-Y4XQGPDY.js.map} +0 -0
- /package/dist/{model-bundle-SQZ3W5YY.js.map → model-bundle-NOZJVM3U.js.map} +0 -0
- /package/dist/{models-JZCTRP7M.js.map → models-LPI23KGR.js.map} +0 -0
- /package/dist/{parser-JCVDTWZK.js.map → parser-CX6X3TA3.js.map} +0 -0
- /package/dist/{parser-IKKZQMTJ.js.map → parser-H5H2U46P.js.map} +0 -0
- /package/dist/{pdf-ocr-53LWVES4.js.map → pdf-ocr-6SMZ52YW.js.map} +0 -0
- /package/dist/{pdf-ocr-EZGDVPJR.js.map → pdf-ocr-TLXMNTAH.js.map} +0 -0
- /package/dist/{profile-io-ZOPP3ZZF.js.map → profile-io-T2AT74YH.js.map} +0 -0
- /package/dist/{rasterize-SSVBOWS7.js.map → rasterize-XOVABIYS.js.map} +0 -0
- /package/dist/{redact-doc-NKOEXJLS.js.map → redact-doc-7AGO4IUN.js.map} +0 -0
- /package/dist/{render-Z3UINVKW.js.map → render-7FBTU4AW.js.map} +0 -0
- /package/dist/{seal-UVB4GNMX.js.map → seal-XLR6S42Z.js.map} +0 -0
- /package/dist/{setup-XFGSO4EL.js.map → setup-XNXUNIK4.js.map} +0 -0
- /package/dist/{visual-WKOKF77U.js.map → visual-QUXWVHOC.js.map} +0 -0
- /package/dist/{watch-OYDMGGU6.js.map → watch-A5SDGA7T.js.map} +0 -0
|
@@ -51,17 +51,17 @@ import {
|
|
|
51
51
|
unknownFontWarnings,
|
|
52
52
|
usesGaejosikMunche,
|
|
53
53
|
validateHwpx
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-7OFYBGLQ.js";
|
|
55
55
|
import {
|
|
56
56
|
blocksToPages
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-3EUEOJJF.js";
|
|
58
58
|
import {
|
|
59
59
|
applySplices,
|
|
60
60
|
buildParagraphSplices,
|
|
61
61
|
buildRangeSplices,
|
|
62
62
|
placeSealHwpx,
|
|
63
63
|
scanSectionXml
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-4Y3EZHTK.js";
|
|
65
65
|
import {
|
|
66
66
|
DEFAULT_REDACT_RULES,
|
|
67
67
|
redactMarkdown,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
} from "./chunk-3WSNLH4B.js";
|
|
70
70
|
import {
|
|
71
71
|
blocksToChunks
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-DKVYQ2UN.js";
|
|
73
73
|
import {
|
|
74
74
|
SPACE_EM_FIXED,
|
|
75
75
|
SPACE_EM_FONT,
|
|
@@ -94,20 +94,20 @@ import {
|
|
|
94
94
|
renderSceneToHtml,
|
|
95
95
|
simulateWrap,
|
|
96
96
|
simulateWrapKeepWord
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-TNCW3J6S.js";
|
|
98
98
|
import "./chunk-7FCNOKOR.js";
|
|
99
|
-
import "./chunk-
|
|
99
|
+
import "./chunk-OLW6GRNW.js";
|
|
100
100
|
import "./chunk-VQFA55IC.js";
|
|
101
|
-
import "./chunk-
|
|
101
|
+
import "./chunk-ISL2ZW7T.js";
|
|
102
102
|
import {
|
|
103
103
|
blocksToMarkdown,
|
|
104
104
|
flattenLayoutTables,
|
|
105
105
|
hasStructuredCellContent
|
|
106
|
-
} from "./chunk-
|
|
107
|
-
import "./chunk-
|
|
106
|
+
} from "./chunk-H5PSOZD2.js";
|
|
107
|
+
import "./chunk-WCSLRLH6.js";
|
|
108
108
|
import {
|
|
109
109
|
VERSION
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-LU7AVESZ.js";
|
|
111
111
|
export {
|
|
112
112
|
BUILTIN_TEMPLATES,
|
|
113
113
|
DEFAULT_REDACT_RULES,
|
|
@@ -198,4 +198,4 @@ export {
|
|
|
198
198
|
usesGaejosikMunche,
|
|
199
199
|
validateHwpx
|
|
200
200
|
};
|
|
201
|
-
//# sourceMappingURL=-
|
|
201
|
+
//# sourceMappingURL=-TBEYOUTF.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
KordocError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LU7AVESZ.js";
|
|
5
5
|
|
|
6
6
|
// src/hwpx/profile-io.ts
|
|
7
7
|
import { z } from "zod";
|
|
@@ -89,4 +89,4 @@ export {
|
|
|
89
89
|
formatProfileSchema,
|
|
90
90
|
parseFormatProfileJson
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-2UDRHJEC.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
blocksToMarkdown
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-H5PSOZD2.js";
|
|
5
5
|
|
|
6
6
|
// src/page-markdown.ts
|
|
7
7
|
function blocksToPages(blocks, render = blocksToMarkdown) {
|
|
@@ -29,4 +29,4 @@ function blocksToPages(blocks, render = blocksToMarkdown) {
|
|
|
29
29
|
export {
|
|
30
30
|
blocksToPages
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-3EUEOJJF.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
parseRenderStyles
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ISL2ZW7T.js";
|
|
5
5
|
import {
|
|
6
6
|
KordocError,
|
|
7
7
|
precheckZipSize
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LU7AVESZ.js";
|
|
9
9
|
|
|
10
10
|
// src/form/seal.ts
|
|
11
11
|
import JSZip from "jszip";
|
|
@@ -1057,4 +1057,4 @@ export {
|
|
|
1057
1057
|
patchZipEntries,
|
|
1058
1058
|
placeSealHwpx
|
|
1059
1059
|
};
|
|
1060
|
-
//# sourceMappingURL=chunk-
|
|
1060
|
+
//# sourceMappingURL=chunk-4Y3EZHTK.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
blocksToPages
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3EUEOJJF.js";
|
|
5
5
|
import {
|
|
6
6
|
allLinesegRemovalSplices,
|
|
7
7
|
applySplices,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
paraTextPureT,
|
|
16
16
|
patchZipEntries,
|
|
17
17
|
scanSectionXml
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4Y3EZHTK.js";
|
|
19
19
|
import {
|
|
20
20
|
CONVERT_MAP,
|
|
21
21
|
FLAG_COMPRESSED,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
romanNumeral,
|
|
66
66
|
simulateWrap,
|
|
67
67
|
takeTocLeaders
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-TNCW3J6S.js";
|
|
69
69
|
import {
|
|
70
70
|
CELL_EDGES,
|
|
71
71
|
HEADING_RATIO_H1,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
tidyScriptTags,
|
|
78
78
|
unframeLayoutTables,
|
|
79
79
|
wrapScript
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-OLW6GRNW.js";
|
|
81
81
|
import {
|
|
82
82
|
parsePageRange
|
|
83
83
|
} from "./chunk-VQFA55IC.js";
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
findChildByLocalName,
|
|
97
97
|
localName,
|
|
98
98
|
rawTextContent
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-ISL2ZW7T.js";
|
|
100
100
|
import {
|
|
101
101
|
MAX_COLS,
|
|
102
102
|
MAX_ROWS,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
hasStructuredCellContent,
|
|
112
112
|
mapPuaText,
|
|
113
113
|
noteSuffix
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-H5PSOZD2.js";
|
|
115
115
|
import {
|
|
116
116
|
KordocError,
|
|
117
117
|
classifyError,
|
|
@@ -127,7 +127,7 @@ import {
|
|
|
127
127
|
toArrayBuffer,
|
|
128
128
|
unescapeHtml,
|
|
129
129
|
unzipLimitBytes
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-LU7AVESZ.js";
|
|
131
131
|
|
|
132
132
|
// src/table/visual.ts
|
|
133
133
|
import { readFile as readFile2 } from "fs/promises";
|
|
@@ -22733,7 +22733,7 @@ function replicateGfmTable(table2) {
|
|
|
22733
22733
|
const cell2 = cells[r]?.[c];
|
|
22734
22734
|
if (!cell2) continue;
|
|
22735
22735
|
display[r][c] = {
|
|
22736
|
-
text: escapeGfm(sanitizeText(cell2.text)).replace(/(?<!\\)\|/g, "\\|").replace(/\n/g, "<br>"),
|
|
22736
|
+
text: escapeGfm(sanitizeText(cell2.text)).replace(/(?<!\\)\|/g, "\\|").replace(/\r\n|\r|\n/g, "<br>"),
|
|
22737
22737
|
gridR: r,
|
|
22738
22738
|
gridC: c
|
|
22739
22739
|
};
|
|
@@ -27483,6 +27483,74 @@ function tableSzHeightSplice(xml, scanTable, tblOpenLen, delta) {
|
|
|
27483
27483
|
return { start: valStart, end: valStart + hM[1].length, replacement: String(newH) };
|
|
27484
27484
|
}
|
|
27485
27485
|
|
|
27486
|
+
// src/roundtrip/embedded-line-patch.ts
|
|
27487
|
+
function buildEmbeddedLineSplices(para2, xml, newLines) {
|
|
27488
|
+
const tokens = [];
|
|
27489
|
+
let text = "";
|
|
27490
|
+
for (const range of para2.tRanges) {
|
|
27491
|
+
if (range.selfClosing) continue;
|
|
27492
|
+
const raw = xml.slice(range.contentStart, range.contentEnd);
|
|
27493
|
+
if (raw.includes("<")) return null;
|
|
27494
|
+
const base = text.length;
|
|
27495
|
+
let cursor = 0;
|
|
27496
|
+
for (const match of raw.matchAll(/&(?:lt|gt|amp|quot|apos|#(?:[0-9]+|x[0-9a-fA-F]+));|[^&]/gu)) {
|
|
27497
|
+
const decoded = decodeXmlEntities(match[0]);
|
|
27498
|
+
if (match.index !== cursor || decoded === match[0] && match[0].startsWith("&")) return null;
|
|
27499
|
+
cursor += match[0].length;
|
|
27500
|
+
tokens.push({
|
|
27501
|
+
from: text.length,
|
|
27502
|
+
to: text.length + decoded.length,
|
|
27503
|
+
start: range.contentStart + match.index,
|
|
27504
|
+
end: range.contentStart + match.index + match[0].length
|
|
27505
|
+
});
|
|
27506
|
+
text += decoded;
|
|
27507
|
+
}
|
|
27508
|
+
if (cursor !== raw.length || decodeXmlEntities(raw) !== text.slice(base)) return null;
|
|
27509
|
+
}
|
|
27510
|
+
if (text !== para2.text || !/[\r\n]/.test(text) || /<br\s*\/?\s*>/i.test(text)) return null;
|
|
27511
|
+
const lines = text.split(/\r\n|\r|\n/);
|
|
27512
|
+
if (lines.length !== newLines.length || lines.some((line) => !line.trim() || sanitizeText(line) !== line.trim())) return null;
|
|
27513
|
+
const splices = [];
|
|
27514
|
+
let offset = 0;
|
|
27515
|
+
for (let i = 0; i < lines.length; i++) {
|
|
27516
|
+
const line = lines[i];
|
|
27517
|
+
const orig = line.trim();
|
|
27518
|
+
const next = newLines[i];
|
|
27519
|
+
if (sanitizeText(next) !== next || /[\r\n]/.test(next) || /[\uD800-\uDFFF]/u.test(next) || decodeXmlEntities(escapeXmlText(next)) !== next) return null;
|
|
27520
|
+
let prefix = 0;
|
|
27521
|
+
while (prefix < orig.length && prefix < next.length && orig[prefix] === next[prefix]) prefix++;
|
|
27522
|
+
if (prefix > 0 && /[\uD800-\uDBFF]/.test(orig[prefix - 1]) && /[\uDC00-\uDFFF]/.test(orig[prefix] ?? "")) prefix--;
|
|
27523
|
+
let suffix = 0;
|
|
27524
|
+
while (suffix < orig.length - prefix && suffix < next.length - prefix && orig[orig.length - 1 - suffix] === next[next.length - 1 - suffix]) suffix++;
|
|
27525
|
+
if (suffix > 0 && /[\uDC00-\uDFFF]/.test(orig[orig.length - suffix]) && /[\uD800-\uDBFF]/.test(orig[orig.length - suffix - 1] ?? "")) suffix--;
|
|
27526
|
+
if (orig !== next) {
|
|
27527
|
+
const start = offset + line.length - line.trimStart().length + prefix;
|
|
27528
|
+
const end = offset + line.length - line.trimStart().length + orig.length - suffix;
|
|
27529
|
+
const replacement = escapeXmlText(next.slice(prefix, next.length - suffix));
|
|
27530
|
+
if (tokens.some((t) => t.from < start && start < t.to || t.from < end && end < t.to)) return null;
|
|
27531
|
+
if (start === end) {
|
|
27532
|
+
const token = tokens.find((t) => t.from === start) ?? tokens.find((t) => t.to === start);
|
|
27533
|
+
if (!token) return null;
|
|
27534
|
+
const at = token.from === start ? token.start : token.end;
|
|
27535
|
+
splices.push({ start: at, end: at, replacement });
|
|
27536
|
+
} else {
|
|
27537
|
+
let placed = false;
|
|
27538
|
+
for (const token of tokens) {
|
|
27539
|
+
if (token.to <= start || token.from >= end) continue;
|
|
27540
|
+
const previous = splices[splices.length - 1];
|
|
27541
|
+
if (placed && previous.end === token.start) previous.end = token.end;
|
|
27542
|
+
else splices.push({ start: token.start, end: token.end, replacement: placed ? "" : replacement });
|
|
27543
|
+
placed = true;
|
|
27544
|
+
}
|
|
27545
|
+
if (!placed) return null;
|
|
27546
|
+
}
|
|
27547
|
+
}
|
|
27548
|
+
offset += line.length;
|
|
27549
|
+
offset += text.slice(offset).match(/^(?:\r\n|\r|\n)/)?.[0].length ?? 0;
|
|
27550
|
+
}
|
|
27551
|
+
return splices;
|
|
27552
|
+
}
|
|
27553
|
+
|
|
27486
27554
|
// src/roundtrip/table-patch.ts
|
|
27487
27555
|
function patchGfmTable(table2, scanTable, orig, edited, ctx, skip) {
|
|
27488
27556
|
const replica = replicateGfmTable(table2);
|
|
@@ -27743,6 +27811,17 @@ function applyCellEdit(table2, scanTable, gridR, gridC, newLines, ctx, before, a
|
|
|
27743
27811
|
}
|
|
27744
27812
|
const nonEmpty = cell2.paragraphs.filter((p) => normForMatch(p.text) !== "");
|
|
27745
27813
|
if (origLineCount !== void 0 && nonEmpty.length > 0 && origLineCount !== nonEmpty.length) {
|
|
27814
|
+
const target = nonEmpty.length === 1 ? nonEmpty[0] : void 0;
|
|
27815
|
+
const sourceLines = target?.text.split(/\r\n|\r|\n/).map((line) => line.trim());
|
|
27816
|
+
const renderedLines = unescapeGfmCell(stripCellTokens(before)).split("\n").map((line) => line.trim());
|
|
27817
|
+
if (target && sourceLines?.length === origLineCount && sourceLines.every((line, i) => line === renderedLines[i]) && !extractCellTokens(before)) {
|
|
27818
|
+
const xml = ctx.scans[target.sectionIndex]?.xml;
|
|
27819
|
+
const precise = xml === void 0 ? null : buildEmbeddedLineSplices(target, xml, newLines);
|
|
27820
|
+
if (precise?.length) {
|
|
27821
|
+
ctx.sectionSplices[target.sectionIndex].push(...precise);
|
|
27822
|
+
return 1;
|
|
27823
|
+
}
|
|
27824
|
+
}
|
|
27746
27825
|
return skip("\uC140 \uC904 \uACBD\uACC4 \uB9E4\uD551 \uBAA8\uD638 (\uB9AC\uD130\uB7F4 <br>/\uBB38\uB2E8 \uB0B4 \uC904\uBC14\uAFC8) \u2014 \uBBF8\uC9C0\uC6D0");
|
|
27747
27826
|
}
|
|
27748
27827
|
const splices = [];
|
|
@@ -30078,7 +30157,7 @@ function scriptsOff(r, off) {
|
|
|
30078
30157
|
}
|
|
30079
30158
|
async function parseImage(buffer, options) {
|
|
30080
30159
|
try {
|
|
30081
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
30160
|
+
const { parseImageDocument } = await import("./image-ocr-Y4XQGPDY.js");
|
|
30082
30161
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
30083
30162
|
stripScriptTags({ blocks });
|
|
30084
30163
|
return {
|
|
@@ -30138,7 +30217,7 @@ async function parseHwp(buffer, options) {
|
|
|
30138
30217
|
async function parsePdf(buffer, options) {
|
|
30139
30218
|
let parsePdfDocument;
|
|
30140
30219
|
try {
|
|
30141
|
-
const mod = await import("./parser-
|
|
30220
|
+
const mod = await import("./parser-CX6X3TA3.js");
|
|
30142
30221
|
parsePdfDocument = mod.parsePdfDocument;
|
|
30143
30222
|
} catch {
|
|
30144
30223
|
return {
|
|
@@ -30361,4 +30440,4 @@ export {
|
|
|
30361
30440
|
parseHwpml,
|
|
30362
30441
|
fillForm
|
|
30363
30442
|
};
|
|
30364
|
-
//# sourceMappingURL=chunk-
|
|
30443
|
+
//# sourceMappingURL=chunk-7OFYBGLQ.js.map
|