kordoc 4.25.21 → 4.25.23
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/README.md +3 -3
- package/dist/{chunk-PVOLFVXE.js → chunk-2PQMHHX4.js} +2 -2
- package/dist/{chunk-6I3X54AQ.js → chunk-377GAL46.js} +2 -2
- package/dist/{chunk-ZCMMU34Z.js → chunk-3IVEGZI3.js} +2 -2
- package/dist/{chunk-5ULHNZ3P.js → chunk-7LW2HG7F.js} +3 -3
- package/dist/{chunk-LSUTK3DH.js → chunk-7S4KRBXC.js} +2 -2
- package/dist/{chunk-COJYQKGH.js → chunk-B3LK5RVY.js} +83 -4
- package/dist/chunk-B3LK5RVY.js.map +7 -0
- package/dist/{chunk-QNJ2LMUO.js → chunk-BXHO5BB5.js} +8 -8
- package/dist/{chunk-HQILGS2O.js → chunk-GMYXTUSJ.js} +2 -2
- package/dist/{chunk-6MCJHRSM.js → chunk-GZX5UQ4P.js} +2 -2
- package/dist/{chunk-3AYNFK6J.js → chunk-IRR32NHL.js} +2 -2
- package/dist/{chunk-FDSFXE2L.js → chunk-J4OTJFSW.js} +2 -2
- package/dist/{chunk-TI6S3KZF.js → chunk-K5ZUKPU3.js} +2 -2
- package/dist/{chunk-W5AHXAUP.js → chunk-LTXF66N6.js} +7 -7
- package/dist/{chunk-B2SRYWEY.js → chunk-MJ2B3EXE.js} +19 -1
- package/dist/{chunk-B2SRYWEY.js.map → chunk-MJ2B3EXE.js.map} +2 -2
- package/dist/{chunk-TYJSNW4Z.js → chunk-MMJIFTWZ.js} +131 -32
- package/dist/chunk-MMJIFTWZ.js.map +7 -0
- package/dist/{chunk-MWCJYIJC.js → chunk-MPEWMDM2.js} +19 -19
- package/dist/{chunk-DHXKCDAU.js → chunk-NFMC6FLB.js} +66 -9
- package/dist/chunk-NFMC6FLB.js.map +7 -0
- package/dist/{chunk-ZO4P735U.js → chunk-PGBRNQAF.js} +2 -2
- package/dist/{chunk-PFNZQ3XI.js → chunk-PQIIJRV2.js} +2 -2
- package/dist/{chunk-S553BW45.js → chunk-QAQDSBAC.js} +6 -6
- package/dist/{chunk-XUBBFY3H.js → chunk-QI7LT4AX.js} +6 -6
- package/dist/{chunk-XUBBFY3H.js.map → chunk-QI7LT4AX.js.map} +2 -2
- package/dist/{chunk-QOCUFTT4.js → chunk-SE5HAJNL.js} +5 -5
- package/dist/{chunk-5MDRUEHP.js → chunk-SKZ2LLN5.js} +237 -4
- package/dist/chunk-SKZ2LLN5.js.map +1 -0
- package/dist/{chunk-KW4JO5CV.js → chunk-TYANRH6O.js} +3 -3
- package/dist/{chunk-DZOA5N5W.js → chunk-WLHQL53U.js} +2 -2
- package/dist/{chunk-24LB25LZ.js → chunk-YDOIXWSF.js} +2 -2
- package/dist/{chunk-GJORKM42.js → chunk-YWRAHQTV.js} +2 -2
- package/dist/chunks-A2NELZR2.js +10 -0
- package/dist/cli.js +38 -38
- package/dist/{formula-HMKT4BZL.js → formula-LUPB363D.js} +4 -4
- package/dist/generator-MK3VLXV2.js +18 -0
- package/dist/{hancom-QWJBWOOE.js → hancom-24SHJFWF.js} +2 -2
- package/dist/{image-ocr-P5AIZNT3.js → image-ocr-CSV7OLPX.js} +11 -11
- package/dist/index.cjs +517 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -22
- package/dist/mcp.js +34 -34
- package/dist/memo-5G32P322.js +15 -0
- package/dist/{model-bundle-5CXCIZHZ.js → model-bundle-U6ONSDTJ.js} +5 -5
- package/dist/{models-PS4L7NLP.js → models-X4FVLSSQ.js} +5 -5
- package/dist/{page-images-QW7IUTUB.js → page-images-E67SJN3S.js} +2 -2
- package/dist/{parse-worker-v2-PRH6KVKP.js → parse-worker-v2-3VY5X7SF.js} +24 -24
- package/dist/{parser-OQIR5ZMI.js → parser-6GFE6B42.js} +14 -14
- package/dist/{pdf-ocr-ZH4JAUTR.js → pdf-ocr-MKQURNXT.js} +9 -9
- package/dist/{profile-io-JFRAM2VE.js → profile-io-DAZZHP7S.js} +3 -3
- package/dist/{rasterize-JJOMUTYX.js → rasterize-BJTBPSDM.js} +3 -3
- package/dist/{redact-doc-A7TW4MNF.js → redact-doc-W6H7SXGB.js} +23 -23
- package/dist/{render-VAOMAQV2.js → render-HJDMKGMV.js} +10 -10
- package/dist/{rewrite-fallback-7PR7V3AZ.js → rewrite-fallback-VKA6BLLT.js} +13 -13
- package/dist/seal-5KR6SUIU.js +14 -0
- package/dist/{setup-6DXZJQCT.js → setup-UGWQLJ5Z.js} +3 -3
- package/dist/{to-hwpx-A56R6H27.js → to-hwpx-WI5CGWDZ.js} +7 -7
- package/dist/visual-YDMDCB7Q.js +42 -0
- package/dist/{watch-7W6CKGX7.js → watch-CIO5522I.js} +23 -23
- package/package.json +1 -1
- package/dist/chunk-5MDRUEHP.js.map +0 -1
- package/dist/chunk-COJYQKGH.js.map +0 -7
- package/dist/chunk-DHXKCDAU.js.map +0 -7
- package/dist/chunk-TYJSNW4Z.js.map +0 -7
- package/dist/chunks-XX7RHVQF.js +0 -10
- package/dist/generator-HOY4SZ26.js +0 -18
- package/dist/memo-Q7772VJD.js +0 -15
- package/dist/seal-RZZNRJFL.js +0 -14
- package/dist/visual-25RY7EFI.js +0 -42
- /package/dist/{chunk-PVOLFVXE.js.map → chunk-2PQMHHX4.js.map} +0 -0
- /package/dist/{chunk-6I3X54AQ.js.map → chunk-377GAL46.js.map} +0 -0
- /package/dist/{chunk-ZCMMU34Z.js.map → chunk-3IVEGZI3.js.map} +0 -0
- /package/dist/{chunk-5ULHNZ3P.js.map → chunk-7LW2HG7F.js.map} +0 -0
- /package/dist/{chunk-LSUTK3DH.js.map → chunk-7S4KRBXC.js.map} +0 -0
- /package/dist/{chunk-QNJ2LMUO.js.map → chunk-BXHO5BB5.js.map} +0 -0
- /package/dist/{chunk-HQILGS2O.js.map → chunk-GMYXTUSJ.js.map} +0 -0
- /package/dist/{chunk-6MCJHRSM.js.map → chunk-GZX5UQ4P.js.map} +0 -0
- /package/dist/{chunk-3AYNFK6J.js.map → chunk-IRR32NHL.js.map} +0 -0
- /package/dist/{chunk-FDSFXE2L.js.map → chunk-J4OTJFSW.js.map} +0 -0
- /package/dist/{chunk-TI6S3KZF.js.map → chunk-K5ZUKPU3.js.map} +0 -0
- /package/dist/{chunk-W5AHXAUP.js.map → chunk-LTXF66N6.js.map} +0 -0
- /package/dist/{chunk-MWCJYIJC.js.map → chunk-MPEWMDM2.js.map} +0 -0
- /package/dist/{chunk-ZO4P735U.js.map → chunk-PGBRNQAF.js.map} +0 -0
- /package/dist/{chunk-PFNZQ3XI.js.map → chunk-PQIIJRV2.js.map} +0 -0
- /package/dist/{chunk-S553BW45.js.map → chunk-QAQDSBAC.js.map} +0 -0
- /package/dist/{chunk-QOCUFTT4.js.map → chunk-SE5HAJNL.js.map} +0 -0
- /package/dist/{chunk-KW4JO5CV.js.map → chunk-TYANRH6O.js.map} +0 -0
- /package/dist/{chunk-DZOA5N5W.js.map → chunk-WLHQL53U.js.map} +0 -0
- /package/dist/{chunk-24LB25LZ.js.map → chunk-YDOIXWSF.js.map} +0 -0
- /package/dist/{chunk-GJORKM42.js.map → chunk-YWRAHQTV.js.map} +0 -0
- /package/dist/{chunks-XX7RHVQF.js.map → chunks-A2NELZR2.js.map} +0 -0
- /package/dist/{formula-HMKT4BZL.js.map → formula-LUPB363D.js.map} +0 -0
- /package/dist/{generator-HOY4SZ26.js.map → generator-MK3VLXV2.js.map} +0 -0
- /package/dist/{hancom-QWJBWOOE.js.map → hancom-24SHJFWF.js.map} +0 -0
- /package/dist/{image-ocr-P5AIZNT3.js.map → image-ocr-CSV7OLPX.js.map} +0 -0
- /package/dist/{memo-Q7772VJD.js.map → memo-5G32P322.js.map} +0 -0
- /package/dist/{model-bundle-5CXCIZHZ.js.map → model-bundle-U6ONSDTJ.js.map} +0 -0
- /package/dist/{models-PS4L7NLP.js.map → models-X4FVLSSQ.js.map} +0 -0
- /package/dist/{page-images-QW7IUTUB.js.map → page-images-E67SJN3S.js.map} +0 -0
- /package/dist/{parse-worker-v2-PRH6KVKP.js.map → parse-worker-v2-3VY5X7SF.js.map} +0 -0
- /package/dist/{parser-OQIR5ZMI.js.map → parser-6GFE6B42.js.map} +0 -0
- /package/dist/{pdf-ocr-ZH4JAUTR.js.map → pdf-ocr-MKQURNXT.js.map} +0 -0
- /package/dist/{profile-io-JFRAM2VE.js.map → profile-io-DAZZHP7S.js.map} +0 -0
- /package/dist/{rasterize-JJOMUTYX.js.map → rasterize-BJTBPSDM.js.map} +0 -0
- /package/dist/{redact-doc-A7TW4MNF.js.map → redact-doc-W6H7SXGB.js.map} +0 -0
- /package/dist/{render-VAOMAQV2.js.map → render-HJDMKGMV.js.map} +0 -0
- /package/dist/{rewrite-fallback-7PR7V3AZ.js.map → rewrite-fallback-VKA6BLLT.js.map} +0 -0
- /package/dist/{seal-RZZNRJFL.js.map → seal-5KR6SUIU.js.map} +0 -0
- /package/dist/{setup-6DXZJQCT.js.map → setup-UGWQLJ5Z.js.map} +0 -0
- /package/dist/{to-hwpx-A56R6H27.js.map → to-hwpx-WI5CGWDZ.js.map} +0 -0
- /package/dist/{visual-25RY7EFI.js.map → visual-YDMDCB7Q.js.map} +0 -0
- /package/dist/{watch-7W6CKGX7.js.map → watch-CIO5522I.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
extractRenderedRegions,
|
|
3
3
|
renderDocumentToScene
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BXHO5BB5.js";
|
|
5
5
|
import {
|
|
6
6
|
EV,
|
|
7
7
|
blocksToPages,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
restoreUnmappedGlyphs,
|
|
18
18
|
spaceMappedDots,
|
|
19
19
|
wmfBitmap
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-2PQMHHX4.js";
|
|
21
21
|
import {
|
|
22
22
|
applyCellEdit,
|
|
23
23
|
buildOrigUnits,
|
|
@@ -29,13 +29,13 @@ import {
|
|
|
29
29
|
resolveParagraphMappings,
|
|
30
30
|
resolveSectionEntryNames,
|
|
31
31
|
stripCellTokens
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-MMJIFTWZ.js";
|
|
33
33
|
import {
|
|
34
34
|
dcxPages,
|
|
35
35
|
hasLibheif,
|
|
36
36
|
heicToRgba,
|
|
37
37
|
pcxToRgba
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-J4OTJFSW.js";
|
|
39
39
|
import {
|
|
40
40
|
WEBP_OPTIONS,
|
|
41
41
|
flushHeifCache,
|
|
@@ -69,10 +69,10 @@ import {
|
|
|
69
69
|
summarize,
|
|
70
70
|
topLevelParagraphs,
|
|
71
71
|
usesV5Engine
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-NFMC6FLB.js";
|
|
73
73
|
import {
|
|
74
74
|
patchZipEntries
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-GZX5UQ4P.js";
|
|
76
76
|
import {
|
|
77
77
|
ANNOTATION_BLANK_RE,
|
|
78
78
|
ValueCursor,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
resolveUnmatched,
|
|
99
99
|
scanInlineSegments,
|
|
100
100
|
scanSectionXml
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-MJ2B3EXE.js";
|
|
102
102
|
import {
|
|
103
103
|
DOMParser,
|
|
104
104
|
MAX_DECOMPRESS_SIZE,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
rawTextContent,
|
|
112
112
|
readZipEntry,
|
|
113
113
|
warnInto
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-377GAL46.js";
|
|
115
115
|
import {
|
|
116
116
|
comResultToParseResult,
|
|
117
117
|
extractTextViaCom,
|
|
@@ -128,7 +128,7 @@ import {
|
|
|
128
128
|
memosMarkdown,
|
|
129
129
|
parseHwp5Document,
|
|
130
130
|
resolveImageBlocks
|
|
131
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-QI7LT4AX.js";
|
|
132
132
|
import {
|
|
133
133
|
MAX_PIXELS,
|
|
134
134
|
bmpToPng,
|
|
@@ -166,7 +166,7 @@ import {
|
|
|
166
166
|
stripScriptTags,
|
|
167
167
|
tidyScriptTags,
|
|
168
168
|
wrapScript
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-YWRAHQTV.js";
|
|
170
170
|
import {
|
|
171
171
|
MAX_COLS,
|
|
172
172
|
MAX_ROWS,
|
|
@@ -177,7 +177,7 @@ import {
|
|
|
177
177
|
flattenLayoutTables,
|
|
178
178
|
hasStructuredCellContent,
|
|
179
179
|
sanitizeText
|
|
180
|
-
} from "./chunk-
|
|
180
|
+
} from "./chunk-IRR32NHL.js";
|
|
181
181
|
import {
|
|
182
182
|
hangulAmount,
|
|
183
183
|
mapPuaText
|
|
@@ -188,7 +188,7 @@ import {
|
|
|
188
188
|
import {
|
|
189
189
|
ensureModelsIn,
|
|
190
190
|
getModelsDir
|
|
191
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-PGBRNQAF.js";
|
|
192
192
|
import {
|
|
193
193
|
BARE_URL,
|
|
194
194
|
KordocError,
|
|
@@ -206,7 +206,7 @@ import {
|
|
|
206
206
|
toArrayBuffer,
|
|
207
207
|
unescapeHtml,
|
|
208
208
|
unzipLimitBytes
|
|
209
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-YDOIXWSF.js";
|
|
210
210
|
|
|
211
211
|
// src/table/visual.ts
|
|
212
212
|
import { readFile as readFile4 } from "node:fs/promises";
|
|
@@ -16984,7 +16984,7 @@ var MIN_SIDE = 24;
|
|
|
16984
16984
|
async function ocrEmbeddedImages(blocks, options, warnings) {
|
|
16985
16985
|
const ocr = options?.ocr;
|
|
16986
16986
|
if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
|
|
16987
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
16987
|
+
const { parseImageDocument } = await import("./image-ocr-CSV7OLPX.js");
|
|
16988
16988
|
let inserted = false, unreadable = 0;
|
|
16989
16989
|
let failed = null;
|
|
16990
16990
|
const walk = async (list, depth) => {
|
|
@@ -21342,8 +21342,8 @@ var MAX_MULTIPAGE_PIXELS = 1e9;
|
|
|
21342
21342
|
var MIN_PAGE_PIXELS = 1e6;
|
|
21343
21343
|
async function parseImage(buffer, options) {
|
|
21344
21344
|
try {
|
|
21345
|
-
const { parseImageDocument, imagePageCount, imagePage, imagePagePixels, decodeToRgba } = await import("./image-ocr-
|
|
21346
|
-
const pageRasters = options?.pageImages ? new (await import("./page-images-
|
|
21345
|
+
const { parseImageDocument, imagePageCount, imagePage, imagePagePixels, decodeToRgba } = await import("./image-ocr-CSV7OLPX.js");
|
|
21346
|
+
const pageRasters = options?.pageImages ? new (await import("./page-images-E67SJN3S.js")).PageImageSink(options.pageImages) : null;
|
|
21347
21347
|
const pageCount = await imagePageCount(buffer);
|
|
21348
21348
|
const wanted = pageCount > 1 && options?.pages ? parsePageRange(options.pages, pageCount) : null;
|
|
21349
21349
|
const blocks = [], warnings = [], lines = [], images = [];
|
|
@@ -21450,7 +21450,7 @@ async function parseHwp(buffer, options) {
|
|
|
21450
21450
|
async function parsePdf(buffer, options) {
|
|
21451
21451
|
let parsePdfDocument;
|
|
21452
21452
|
try {
|
|
21453
|
-
const mod = await import("./parser-
|
|
21453
|
+
const mod = await import("./parser-6GFE6B42.js");
|
|
21454
21454
|
parsePdfDocument = mod.parsePdfDocument;
|
|
21455
21455
|
} catch (err) {
|
|
21456
21456
|
return { success: false, fileType: "pdf", error: sanitizeError(err), code: classifyError(err) };
|
|
@@ -21527,7 +21527,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
21527
21527
|
throw new Error(`hwpx-preserve 포맷은 HWPX·HWP 5.x 입력만 지원합니다 (감지된 포맷: ${zipFormat})`);
|
|
21528
21528
|
}
|
|
21529
21529
|
} else if (format2 === "hwp" && detectOle2Format(buffer) === "hwp") {
|
|
21530
|
-
const { hwpToHwpx: hwpToHwpx2 } = await import("./to-hwpx-
|
|
21530
|
+
const { hwpToHwpx: hwpToHwpx2 } = await import("./to-hwpx-WI5CGWDZ.js");
|
|
21531
21531
|
const hwpx = await hwpToHwpx2(new Uint8Array(buffer));
|
|
21532
21532
|
buffer = hwpx.buffer.slice(hwpx.byteOffset, hwpx.byteOffset + hwpx.byteLength);
|
|
21533
21533
|
} else {
|
|
@@ -21683,4 +21683,4 @@ export {
|
|
|
21683
21683
|
parseHwpml,
|
|
21684
21684
|
fillForm
|
|
21685
21685
|
};
|
|
21686
|
-
//# sourceMappingURL=chunk-
|
|
21686
|
+
//# sourceMappingURL=chunk-MPEWMDM2.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
renderHwpxPages,
|
|
13
13
|
resolveParaHeading,
|
|
14
14
|
simulateWrap
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7LW2HG7F.js";
|
|
16
16
|
import {
|
|
17
17
|
applySplices,
|
|
18
18
|
buildMappedRangeSplices,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
paraTText,
|
|
27
27
|
puaShownMap,
|
|
28
28
|
scanSectionXml
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-MJ2B3EXE.js";
|
|
30
30
|
import {
|
|
31
31
|
MAX_DECOMPRESS_SIZE,
|
|
32
32
|
MAX_XML_DEPTH,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
extractTextFromNode,
|
|
39
39
|
findChildByLocalName,
|
|
40
40
|
readZipEntry
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-377GAL46.js";
|
|
42
42
|
import {
|
|
43
43
|
isEncryptedHwpx
|
|
44
44
|
} from "./chunk-IXQ45P43.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
escapeLiteralTags,
|
|
64
64
|
tidyScriptTags,
|
|
65
65
|
wrapScript
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-YWRAHQTV.js";
|
|
67
67
|
import {
|
|
68
68
|
MAX_COLS,
|
|
69
69
|
MAX_ROWS,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
noteTableHtml,
|
|
82
82
|
sanitizeText,
|
|
83
83
|
visibleText
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-IRR32NHL.js";
|
|
85
85
|
import {
|
|
86
86
|
circledHangul,
|
|
87
87
|
circledNumber,
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
sanitizeHref,
|
|
105
105
|
stripDtd,
|
|
106
106
|
unescapeHtml
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-YDOIXWSF.js";
|
|
108
108
|
|
|
109
109
|
// src/hwpx/generator.ts
|
|
110
110
|
import JSZip2 from "jszip";
|
|
@@ -4040,7 +4040,7 @@ function removeNoteMarks(text, marks) {
|
|
|
4040
4040
|
function noteMarksOf(footnoteText) {
|
|
4041
4041
|
return footnoteText ? footnoteText.split("; ").map((s) => s.match(/^(\S+)\s/)?.[1] ?? "").filter(Boolean) : [];
|
|
4042
4042
|
}
|
|
4043
|
-
function splitCellNote(before, after, skipped) {
|
|
4043
|
+
function splitCellNote(before, after, skipped, editNote) {
|
|
4044
4044
|
const re = /\s*\(주: ([\s\S]*)\)$/;
|
|
4045
4045
|
const bm = before.match(re);
|
|
4046
4046
|
if (!bm) return { before, after, noted: false };
|
|
@@ -4049,12 +4049,66 @@ function splitCellNote(before, after, skipped) {
|
|
|
4049
4049
|
let body = after;
|
|
4050
4050
|
if (am) {
|
|
4051
4051
|
body = after.slice(0, am.index).trimEnd();
|
|
4052
|
-
if (normForMatch(am[1]) !== normForMatch(bm[1])) skipped.push({ reason:
|
|
4052
|
+
if (normForMatch(am[1]) !== normForMatch(bm[1]) && !editNote?.(bm[1], am[1])) skipped.push({ reason: NOTE_TEXT_UNSUPPORTED, before: bm[1], after: am[1] });
|
|
4053
4053
|
} else skipped.push({ reason: "각주 표기 삭제는 미지원 — 각주 유지, 본문만 적용", before: `(주: ${bm[1]})` });
|
|
4054
4054
|
const r = removeNoteMarks(body, marks);
|
|
4055
4055
|
if (r.missing.length) skipped.push({ reason: "각주 참조 부호 삭제는 미지원 — 각주 유지, 본문만 적용", before: r.missing.join(" ") });
|
|
4056
4056
|
return { before: removeNoteMarks(before.slice(0, bm.index).trimEnd(), marks).text, after: r.text, noted: true };
|
|
4057
4057
|
}
|
|
4058
|
+
var NOTE_TEXT_UNSUPPORTED = "각주 텍스트 수정은 미지원 — 본문만 적용";
|
|
4059
|
+
function planNoteEdits(origNote, newNote, bodies) {
|
|
4060
|
+
const orig = normForMatch(origNote);
|
|
4061
|
+
const heads = [];
|
|
4062
|
+
let pos = 0;
|
|
4063
|
+
for (const body of bodies) {
|
|
4064
|
+
const key = normForMatch(body);
|
|
4065
|
+
const at = key ? orig.indexOf(key, pos) : -1;
|
|
4066
|
+
if (at < 0) return NOTE_TEXT_UNSUPPORTED;
|
|
4067
|
+
heads.push(orig.slice(pos, at));
|
|
4068
|
+
pos = at + key.length;
|
|
4069
|
+
}
|
|
4070
|
+
if (!bodies.length || pos !== orig.length || heads.some((h, k) => k > 0 && !h.startsWith("; "))) return NOTE_TEXT_UNSUPPORTED;
|
|
4071
|
+
const split = (text) => {
|
|
4072
|
+
const out = [];
|
|
4073
|
+
let p = 0;
|
|
4074
|
+
for (let k = 0; k < heads.length; k++) {
|
|
4075
|
+
if (!text.startsWith(heads[k], p)) return null;
|
|
4076
|
+
p += heads[k].length;
|
|
4077
|
+
const next = k + 1 < heads.length ? text.indexOf(heads[k + 1], p) : text.length;
|
|
4078
|
+
if (next < 0) return null;
|
|
4079
|
+
out.push(text.slice(p, next));
|
|
4080
|
+
p = next;
|
|
4081
|
+
}
|
|
4082
|
+
return out;
|
|
4083
|
+
};
|
|
4084
|
+
const before = split(orig);
|
|
4085
|
+
if (!before || before.some((b, k) => b !== normForMatch(bodies[k]))) return NOTE_TEXT_UNSUPPORTED;
|
|
4086
|
+
const after = split(newNote.replace(/\s+/g, " ").trim());
|
|
4087
|
+
if (!after) return "각주 번호 수정·각주 추가·삭제는 미지원 — 각주 글 수정 미적용";
|
|
4088
|
+
const edits = [];
|
|
4089
|
+
for (let k = 0; k < before.length; k++) {
|
|
4090
|
+
if (normForMatch(after[k]) === before[k]) continue;
|
|
4091
|
+
if (!after[k].trim()) return "각주 글 비우기는 미지원 — 각주 글 수정 미적용";
|
|
4092
|
+
if (sanitizeText(after[k]) !== after[k]) return "공백 정규화 불안정 텍스트 — 각주 글 수정 미적용";
|
|
4093
|
+
edits.push({ index: k, before: before[k], after: after[k] });
|
|
4094
|
+
}
|
|
4095
|
+
return edits;
|
|
4096
|
+
}
|
|
4097
|
+
function noteParaEdit(paraTexts, before, after) {
|
|
4098
|
+
if (paraTexts.length === 1) return { index: 0, before, after };
|
|
4099
|
+
if (!paraTexts.length || before !== paraTexts.join(" ")) return null;
|
|
4100
|
+
let p = 0;
|
|
4101
|
+
while (p < before.length && p < after.length && before[p] === after[p]) p++;
|
|
4102
|
+
let s = 0;
|
|
4103
|
+
while (s < before.length - p && s < after.length - p && before[before.length - 1 - s] === after[after.length - 1 - s]) s++;
|
|
4104
|
+
let off = 0;
|
|
4105
|
+
for (let i = 0; i < paraTexts.length; i++) {
|
|
4106
|
+
const end = off + paraTexts[i].length;
|
|
4107
|
+
if (off <= p && before.length - s <= end) return { index: i, before: paraTexts[i], after: after.slice(off, after.length - (before.length - end)) };
|
|
4108
|
+
off = end + 1;
|
|
4109
|
+
}
|
|
4110
|
+
return null;
|
|
4111
|
+
}
|
|
4058
4112
|
|
|
4059
4113
|
// src/hwpx/gen-table-bf.ts
|
|
4060
4114
|
var THIN = ["0.12 mm", "#000000"];
|
|
@@ -11072,6 +11126,9 @@ export {
|
|
|
11072
11126
|
removeNoteMarks,
|
|
11073
11127
|
noteMarksOf,
|
|
11074
11128
|
splitCellNote,
|
|
11129
|
+
NOTE_TEXT_UNSUPPORTED,
|
|
11130
|
+
planNoteEdits,
|
|
11131
|
+
noteParaEdit,
|
|
11075
11132
|
EMPH_BOLD,
|
|
11076
11133
|
EMPH_ITALIC,
|
|
11077
11134
|
EMPH_STRIKE,
|
|
@@ -11125,4 +11182,4 @@ export {
|
|
|
11125
11182
|
markdownToHwpxFromTemplate,
|
|
11126
11183
|
markdownToHwpx
|
|
11127
11184
|
};
|
|
11128
|
-
//# sourceMappingURL=chunk-
|
|
11185
|
+
//# sourceMappingURL=chunk-NFMC6FLB.js.map
|