kordoc 4.3.0 → 4.3.1
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/{-DYHT3HWH.js → -RH6BEVTT.js} +8 -8
- package/dist/{chunk-AL34DGS5.cjs → chunk-5F5UCACZ.cjs} +3 -3
- package/dist/{chunk-AL34DGS5.cjs.map → chunk-5F5UCACZ.cjs.map} +1 -1
- package/dist/{chunk-LPQWKQQQ.cjs → chunk-7DZPPUQD.cjs} +9 -9
- package/dist/{chunk-LPQWKQQQ.cjs.map → chunk-7DZPPUQD.cjs.map} +1 -1
- package/dist/{chunk-GSMPTZC7.js → chunk-BPJSTJBN.js} +2 -2
- package/dist/{chunk-NMWXBJ5B.js → chunk-BYEQDLZS.js} +3 -3
- package/dist/{chunk-EZHW3RNQ.js → chunk-CD5X6UG5.js} +2 -2
- package/dist/{chunk-US4WFSIQ.js → chunk-FUXDD36A.js} +2 -2
- package/dist/{chunk-WFOQFJI4.js → chunk-GTPEKBN6.js} +2 -2
- package/dist/{chunk-4DBCUF3C.js → chunk-HPRK67YB.js} +2 -2
- package/dist/{chunk-EFVAY5VE.js → chunk-HZU7Y22R.js} +2 -2
- package/dist/{chunk-7MFO4TKP.js → chunk-LEC2HG7A.js} +2 -2
- package/dist/{chunk-ARXNKC5D.js → chunk-PV3NVBGL.js} +2 -2
- package/dist/{chunk-DRZUJ2RK.js → chunk-RO4Y4BFI.js} +8 -8
- package/dist/{chunk-VXMLENCV.js → chunk-SA22NK56.js} +3 -3
- package/dist/{chunk-JFV7QT5T.cjs → chunk-VQB5P5KJ.cjs} +2 -2
- package/dist/{chunk-JFV7QT5T.cjs.map → chunk-VQB5P5KJ.cjs.map} +1 -1
- package/dist/{chunk-6RAYTNQT.js → chunk-YDCD4AV4.js} +2 -2
- package/dist/{chunk-DRQUAYNT.js → chunk-ZJ75YDW7.js} +2 -2
- package/dist/{chunk-AUOEZKJE.cjs → chunk-ZMKTKJZN.cjs} +4 -4
- package/dist/{chunk-AUOEZKJE.cjs.map → chunk-ZMKTKJZN.cjs.map} +1 -1
- package/dist/{chunk-SPKBIFSK.js → chunk-ZYYTU7NY.js} +2 -2
- package/dist/chunks-JEYQWXIZ.js +10 -0
- package/dist/cli.js +16 -16
- package/dist/{image-ocr-G2LYTEUH.js → image-ocr-6MO4FXJK.js} +4 -4
- package/dist/{image-ocr-XEJFXH6M.cjs → image-ocr-MGVXT6XD.cjs} +10 -10
- package/dist/{image-ocr-XEJFXH6M.cjs.map → image-ocr-MGVXT6XD.cjs.map} +1 -1
- package/dist/{image-ocr-R44RYDBU.js → image-ocr-TWUU2RNG.js} +4 -4
- package/dist/index.cjs +157 -157
- package/dist/index.js +4 -4
- package/dist/mcp.js +14 -14
- package/dist/{parser-W3ZGQUCQ.cjs → parser-JFGLN4DA.cjs} +24 -24
- package/dist/{parser-W3ZGQUCQ.cjs.map → parser-JFGLN4DA.cjs.map} +1 -1
- package/dist/{parser-W3POOYQQ.js → parser-VR2BTUT7.js} +5 -5
- package/dist/{parser-2G245MMN.js → parser-YA7HSSPK.js} +5 -5
- package/dist/pdf-ocr-4LISPZEM.cjs +13 -0
- package/dist/{pdf-ocr-N7IU23UV.cjs.map → pdf-ocr-4LISPZEM.cjs.map} +1 -1
- package/dist/pdf-ocr-AIWB2QCS.js +12 -0
- package/dist/{pdf-ocr-3GDTJSHF.js → pdf-ocr-QMOKUMC2.js} +4 -4
- package/dist/{profile-io-72R3B7KO.js → profile-io-QPIMGVO3.js} +3 -3
- package/dist/{rasterize-GNJQVURE.js → rasterize-AFYGNKXG.js} +2 -2
- package/dist/render-PSPTMZIZ.js +10 -0
- package/dist/seal-4XBJ7ISE.js +10 -0
- package/dist/{watch-2ADAJLIJ.js → watch-D3JJEOAB.js} +8 -8
- package/package.json +1 -1
- package/templates//354/235/274/353/260/230/352/270/260/354/225/210/353/254/270_/354/204/234/354/213/235.hwpx +0 -0
- package/dist/chunks-Q7T4SQGW.js +0 -10
- package/dist/pdf-ocr-N7IU23UV.cjs +0 -13
- package/dist/pdf-ocr-U7MEGNBZ.js +0 -12
- package/dist/render-6OW6U4L4.js +0 -10
- package/dist/seal-GTNLVBJX.js +0 -10
- /package/dist/{-DYHT3HWH.js.map → -RH6BEVTT.js.map} +0 -0
- /package/dist/{chunk-GSMPTZC7.js.map → chunk-BPJSTJBN.js.map} +0 -0
- /package/dist/{chunk-NMWXBJ5B.js.map → chunk-BYEQDLZS.js.map} +0 -0
- /package/dist/{chunk-EZHW3RNQ.js.map → chunk-CD5X6UG5.js.map} +0 -0
- /package/dist/{chunk-US4WFSIQ.js.map → chunk-FUXDD36A.js.map} +0 -0
- /package/dist/{chunk-WFOQFJI4.js.map → chunk-GTPEKBN6.js.map} +0 -0
- /package/dist/{chunk-4DBCUF3C.js.map → chunk-HPRK67YB.js.map} +0 -0
- /package/dist/{chunk-EFVAY5VE.js.map → chunk-HZU7Y22R.js.map} +0 -0
- /package/dist/{chunk-7MFO4TKP.js.map → chunk-LEC2HG7A.js.map} +0 -0
- /package/dist/{chunk-ARXNKC5D.js.map → chunk-PV3NVBGL.js.map} +0 -0
- /package/dist/{chunk-DRZUJ2RK.js.map → chunk-RO4Y4BFI.js.map} +0 -0
- /package/dist/{chunk-VXMLENCV.js.map → chunk-SA22NK56.js.map} +0 -0
- /package/dist/{chunk-6RAYTNQT.js.map → chunk-YDCD4AV4.js.map} +0 -0
- /package/dist/{chunk-DRQUAYNT.js.map → chunk-ZJ75YDW7.js.map} +0 -0
- /package/dist/{chunk-SPKBIFSK.js.map → chunk-ZYYTU7NY.js.map} +0 -0
- /package/dist/{chunks-Q7T4SQGW.js.map → chunks-JEYQWXIZ.js.map} +0 -0
- /package/dist/{image-ocr-G2LYTEUH.js.map → image-ocr-6MO4FXJK.js.map} +0 -0
- /package/dist/{image-ocr-R44RYDBU.js.map → image-ocr-TWUU2RNG.js.map} +0 -0
- /package/dist/{parser-W3POOYQQ.js.map → parser-VR2BTUT7.js.map} +0 -0
- /package/dist/{parser-2G245MMN.js.map → parser-YA7HSSPK.js.map} +0 -0
- /package/dist/{pdf-ocr-3GDTJSHF.js.map → pdf-ocr-AIWB2QCS.js.map} +0 -0
- /package/dist/{pdf-ocr-U7MEGNBZ.js.map → pdf-ocr-QMOKUMC2.js.map} +0 -0
- /package/dist/{profile-io-72R3B7KO.js.map → profile-io-QPIMGVO3.js.map} +0 -0
- /package/dist/{rasterize-GNJQVURE.js.map → rasterize-AFYGNKXG.js.map} +0 -0
- /package/dist/{render-6OW6U4L4.js.map → render-PSPTMZIZ.js.map} +0 -0
- /package/dist/{seal-GTNLVBJX.js.map → seal-4XBJ7ISE.js.map} +0 -0
- /package/dist/{watch-2ADAJLIJ.js.map → watch-D3JJEOAB.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkZMKTKJZNcjs = require('./chunk-ZMKTKJZN.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _chunkDCZVOIEOcjs = require('./chunk-DCZVOIEO.cjs');
|
|
@@ -27,7 +27,7 @@ var _chunkDCZVOIEOcjs = require('./chunk-DCZVOIEO.cjs');
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkVQB5P5KJcjs = require('./chunk-VQB5P5KJ.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var _chunkGS7T56RPcjs = require('./chunk-GS7T56RP.cjs');
|
|
@@ -475,7 +475,7 @@ function rawTextContent(node, depth = 0) {
|
|
|
475
475
|
// src/hwpx/parser-shared.ts
|
|
476
476
|
var MAX_DECOMPRESS_SIZE = 256 * 1024 * 1024;
|
|
477
477
|
var MAX_ZIP_ENTRIES = 500;
|
|
478
|
-
var ZipBombError = class extends
|
|
478
|
+
var ZipBombError = class extends _chunkVQB5P5KJcjs.KordocError {
|
|
479
479
|
constructor(message) {
|
|
480
480
|
super(message);
|
|
481
481
|
this.name = "ZipBombError";
|
|
@@ -490,7 +490,7 @@ function createSectionShared() {
|
|
|
490
490
|
function createXmlParser(warnings) {
|
|
491
491
|
return new (0, _xmldom.DOMParser)({
|
|
492
492
|
onError(level, msg2) {
|
|
493
|
-
if (level === "fatalError") throw new (0,
|
|
493
|
+
if (level === "fatalError") throw new (0, _chunkVQB5P5KJcjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
|
|
494
494
|
_optionalChain([warnings, 'optionalAccess', _3 => _3.push, 'call', _4 => _4({ code: "MALFORMED_XML", message: `XML ${level === "warning" ? "\uACBD\uACE0" : "\uC624\uB958"}: ${msg2}` })]);
|
|
495
495
|
}
|
|
496
496
|
});
|
|
@@ -544,10 +544,10 @@ async function extractHwpxStyles(zip, decompressed) {
|
|
|
544
544
|
const xml = await file.async("text");
|
|
545
545
|
if (decompressed) {
|
|
546
546
|
decompressed.total += xml.length * 2;
|
|
547
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
547
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
548
548
|
}
|
|
549
549
|
const parser = createXmlParser();
|
|
550
|
-
const doc = parser.parseFromString(
|
|
550
|
+
const doc = parser.parseFromString(_chunkVQB5P5KJcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
551
551
|
if (!doc.documentElement) continue;
|
|
552
552
|
const domDoc = doc;
|
|
553
553
|
parseCharProperties(domDoc, result.charProperties);
|
|
@@ -734,9 +734,9 @@ function detectHwpxHeadings(blocks, styleMap) {
|
|
|
734
734
|
let level = 0;
|
|
735
735
|
if (baseFontSize > 0 && _optionalChain([block, 'access', _11 => _11.style, 'optionalAccess', _12 => _12.fontSize])) {
|
|
736
736
|
const ratio = block.style.fontSize / baseFontSize;
|
|
737
|
-
if (ratio >=
|
|
738
|
-
else if (ratio >=
|
|
739
|
-
else if (ratio >=
|
|
737
|
+
if (ratio >= _chunkVQB5P5KJcjs.HEADING_RATIO_H1) level = 1;
|
|
738
|
+
else if (ratio >= _chunkVQB5P5KJcjs.HEADING_RATIO_H2) level = 2;
|
|
739
|
+
else if (ratio >= _chunkVQB5P5KJcjs.HEADING_RATIO_H3) level = 3;
|
|
740
740
|
}
|
|
741
741
|
const compactText = text.replace(/\s+/g, "");
|
|
742
742
|
if (/^제\d+[조장절편]/.test(compactText) && text.length <= 50) {
|
|
@@ -1329,7 +1329,7 @@ function resolveParaHeading(paraEl, ctx) {
|
|
|
1329
1329
|
|
|
1330
1330
|
// src/hwpx/table-build.ts
|
|
1331
1331
|
function buildTableWithCellMeta(state, keepAnchoredEmptyCols, keepEmptyParagraphs) {
|
|
1332
|
-
const table2 =
|
|
1332
|
+
const table2 = _chunkZMKTKJZNcjs.buildTable.call(void 0, state.rows, { keepAnchoredEmptyCols, keepEmptyParagraphs });
|
|
1333
1333
|
if (state.caption) table2.caption = state.caption;
|
|
1334
1334
|
if (_optionalChain([state, 'access', _16 => _16.captionBlocks, 'optionalAccess', _17 => _17.length])) table2.captionBlocks = state.captionBlocks;
|
|
1335
1335
|
const anchors = [];
|
|
@@ -1400,7 +1400,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
|
|
|
1400
1400
|
const cell2 = parentTable.cell;
|
|
1401
1401
|
(cell2.blocks ??= []).push(block);
|
|
1402
1402
|
cell2.hasStructure = true;
|
|
1403
|
-
let flat =
|
|
1403
|
+
let flat = _chunkZMKTKJZNcjs.convertTableToText.call(void 0, newTable.rows);
|
|
1404
1404
|
if (newTable.caption) flat = newTable.caption + (flat ? "\n" + flat : "");
|
|
1405
1405
|
if (flat) {
|
|
1406
1406
|
const inlineJoin = newTable.inline === true && cell2.lineOpen === true;
|
|
@@ -1416,7 +1416,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
|
|
|
1416
1416
|
// src/hwpx/section-walker.ts
|
|
1417
1417
|
function parseSectionXml(xml, styleMap, warnings, sectionNum, shared) {
|
|
1418
1418
|
const parser = createXmlParser(warnings);
|
|
1419
|
-
const doc = parser.parseFromString(
|
|
1419
|
+
const doc = parser.parseFromString(_chunkVQB5P5KJcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
1420
1420
|
if (!doc.documentElement) return [];
|
|
1421
1421
|
const ctx = { styleMap, warnings, sectionNum, shared: _nullishCoalesce(shared, () => ( createSectionShared())) };
|
|
1422
1422
|
ctx.shared.track.deleteDepth = 0;
|
|
@@ -1523,8 +1523,8 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
|
|
|
1523
1523
|
const cs = isNaN(rawCs) ? 1 : rawCs;
|
|
1524
1524
|
const rawRs = parseInt(el.getAttribute("rowSpan") || "1", 10);
|
|
1525
1525
|
const rs = isNaN(rawRs) ? 1 : rawRs;
|
|
1526
|
-
tableCtx.cell.colSpan = clampSpan(cs,
|
|
1527
|
-
tableCtx.cell.rowSpan = clampSpan(rs,
|
|
1526
|
+
tableCtx.cell.colSpan = clampSpan(cs, _chunkZMKTKJZNcjs.MAX_COLS);
|
|
1527
|
+
tableCtx.cell.rowSpan = clampSpan(rs, _chunkZMKTKJZNcjs.MAX_ROWS);
|
|
1528
1528
|
}
|
|
1529
1529
|
break;
|
|
1530
1530
|
case "p": {
|
|
@@ -1795,7 +1795,7 @@ function buildSubListTable(el, ctx, depth) {
|
|
|
1795
1795
|
const sink = [];
|
|
1796
1796
|
const st = { rows: [], currentRow: [], cell: null };
|
|
1797
1797
|
walkSection(el, sink, st, [], ctx, depth + 1);
|
|
1798
|
-
let flat =
|
|
1798
|
+
let flat = _chunkZMKTKJZNcjs.convertTableToText.call(void 0, st.rows);
|
|
1799
1799
|
if (st.caption) flat = st.caption + (flat ? "\n" + flat : "");
|
|
1800
1800
|
const built = [];
|
|
1801
1801
|
completeTable(st, [], built, ctx);
|
|
@@ -1950,7 +1950,7 @@ function extractHyperlinkHref(fieldBegin) {
|
|
|
1950
1950
|
let url = (ch.textContent || "").trim();
|
|
1951
1951
|
if (!url) continue;
|
|
1952
1952
|
url = url.replace(/^https?:\/\/(?=https?:\/\/)/i, "");
|
|
1953
|
-
const safe =
|
|
1953
|
+
const safe = _chunkVQB5P5KJcjs.sanitizeHref.call(void 0, url);
|
|
1954
1954
|
if (safe) return safe;
|
|
1955
1955
|
}
|
|
1956
1956
|
return void 0;
|
|
@@ -2110,7 +2110,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
2110
2110
|
case "hyperlink": {
|
|
2111
2111
|
const url = child.getAttribute("url") || child.getAttribute("href") || "";
|
|
2112
2112
|
if (url) {
|
|
2113
|
-
const safe =
|
|
2113
|
+
const safe = _chunkVQB5P5KJcjs.sanitizeHref.call(void 0, url);
|
|
2114
2114
|
if (safe) href = safe;
|
|
2115
2115
|
}
|
|
2116
2116
|
walk(child, depth + 1);
|
|
@@ -2391,7 +2391,7 @@ function decompressStream(data) {
|
|
|
2391
2391
|
return _zlib.inflateRawSync.call(void 0, data, opts);
|
|
2392
2392
|
}
|
|
2393
2393
|
function parseFileHeader(data) {
|
|
2394
|
-
if (data.length < 40) throw new (0,
|
|
2394
|
+
if (data.length < 40) throw new (0, _chunkVQB5P5KJcjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
|
|
2395
2395
|
const sig = data.subarray(0, 32).toString("utf8").replace(/\0+$/, "");
|
|
2396
2396
|
return {
|
|
2397
2397
|
signature: sig,
|
|
@@ -2843,13 +2843,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
2843
2843
|
}
|
|
2844
2844
|
const allCandidates = resolvedPath ? [resolvedPath, ...candidates] : candidates;
|
|
2845
2845
|
for (const path of allCandidates) {
|
|
2846
|
-
if (
|
|
2846
|
+
if (_chunkVQB5P5KJcjs.isPathTraversal.call(void 0, path)) continue;
|
|
2847
2847
|
const file = zip.file(path);
|
|
2848
2848
|
if (!file) continue;
|
|
2849
2849
|
try {
|
|
2850
2850
|
const data = await file.async("uint8array");
|
|
2851
2851
|
decompressed.total += data.length;
|
|
2852
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
2852
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
2853
2853
|
const ext = path.includes(".") ? path.split(".").pop() || "png" : "png";
|
|
2854
2854
|
const mimeType = imageExtToMime(ext);
|
|
2855
2855
|
imageIndex++;
|
|
@@ -2859,7 +2859,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
2859
2859
|
usedPaths.add(path);
|
|
2860
2860
|
break;
|
|
2861
2861
|
} catch (err) {
|
|
2862
|
-
if (err instanceof
|
|
2862
|
+
if (err instanceof _chunkVQB5P5KJcjs.KordocError) throw err;
|
|
2863
2863
|
}
|
|
2864
2864
|
}
|
|
2865
2865
|
if (!img) _optionalChain([warnings, 'optionalAccess', _75 => _75.push, 'call', _76 => _76({ page: block.pageNumber, message: `\uC774\uBBF8\uC9C0 \uD30C\uC77C \uC5C6\uC74C: ${ref}`, code: "SKIPPED_IMAGE" })]);
|
|
@@ -2879,11 +2879,11 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
2879
2879
|
if (sweepUnreferenced) {
|
|
2880
2880
|
const binEntries = zip.file(/(?:^|\/)BinData\//i);
|
|
2881
2881
|
for (const file of binEntries) {
|
|
2882
|
-
if (file.dir || usedPaths.has(file.name) ||
|
|
2882
|
+
if (file.dir || usedPaths.has(file.name) || _chunkVQB5P5KJcjs.isPathTraversal.call(void 0, file.name)) continue;
|
|
2883
2883
|
try {
|
|
2884
2884
|
const data = await file.async("uint8array");
|
|
2885
2885
|
decompressed.total += data.length;
|
|
2886
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
2886
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
2887
2887
|
const ext = file.name.includes(".") ? file.name.split(".").pop() || "" : "";
|
|
2888
2888
|
let mimeType = imageExtToMime(ext);
|
|
2889
2889
|
if (mimeType === "application/octet-stream") {
|
|
@@ -2897,7 +2897,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
2897
2897
|
images.push(img);
|
|
2898
2898
|
blocks.push({ type: "image", text: filename, imageData: { data, mimeType, filename: file.name } });
|
|
2899
2899
|
} catch (err) {
|
|
2900
|
-
if (err instanceof
|
|
2900
|
+
if (err instanceof _chunkVQB5P5KJcjs.KordocError) throw err;
|
|
2901
2901
|
_optionalChain([warnings, 'optionalAccess', _77 => _77.push, 'call', _78 => _78({ message: `\uC774\uBBF8\uC9C0 \uCD94\uCD9C \uC2E4\uD328: ${file.name}`, code: "SKIPPED_IMAGE" })]);
|
|
2902
2902
|
}
|
|
2903
2903
|
}
|
|
@@ -2948,7 +2948,7 @@ function extractFromBrokenZip(buffer) {
|
|
|
2948
2948
|
}
|
|
2949
2949
|
const nameBytes = data.slice(pos + 30, pos + 30 + nameLen);
|
|
2950
2950
|
const name = new TextDecoder().decode(nameBytes);
|
|
2951
|
-
if (
|
|
2951
|
+
if (_chunkVQB5P5KJcjs.isPathTraversal.call(void 0, name)) {
|
|
2952
2952
|
pos = fileStart + compSize;
|
|
2953
2953
|
continue;
|
|
2954
2954
|
}
|
|
@@ -2966,16 +2966,16 @@ function extractFromBrokenZip(buffer) {
|
|
|
2966
2966
|
continue;
|
|
2967
2967
|
}
|
|
2968
2968
|
totalDecompressed += content.length * 2;
|
|
2969
|
-
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
2969
|
+
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
|
|
2970
2970
|
sectionNum++;
|
|
2971
2971
|
blocks.push(...parseSectionXml(content, void 0, warnings, sectionNum, shared));
|
|
2972
2972
|
} catch (e16) {
|
|
2973
2973
|
continue;
|
|
2974
2974
|
}
|
|
2975
2975
|
}
|
|
2976
|
-
if (blocks.length === 0) throw new (0,
|
|
2976
|
+
if (blocks.length === 0) throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
2977
2977
|
applyPageText(blocks, shared);
|
|
2978
|
-
const markdown =
|
|
2978
|
+
const markdown = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, blocks);
|
|
2979
2979
|
return { markdown, blocks, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
2980
2980
|
}
|
|
2981
2981
|
async function readKordocLayout(zip) {
|
|
@@ -3000,18 +3000,18 @@ async function resolveSectionPaths(zip) {
|
|
|
3000
3000
|
if (paths.length > 0) return paths;
|
|
3001
3001
|
}
|
|
3002
3002
|
const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/);
|
|
3003
|
-
return sectionFiles.map((f) => f.name).sort(
|
|
3003
|
+
return sectionFiles.map((f) => f.name).sort(_chunkVQB5P5KJcjs.compareSectionPaths);
|
|
3004
3004
|
}
|
|
3005
3005
|
function parseSectionPathsFromManifest(xml) {
|
|
3006
3006
|
const parser = createXmlParser();
|
|
3007
|
-
const doc = parser.parseFromString(
|
|
3007
|
+
const doc = parser.parseFromString(_chunkVQB5P5KJcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3008
3008
|
const items = doc.getElementsByTagName("opf:item");
|
|
3009
3009
|
const spine = doc.getElementsByTagName("opf:itemref");
|
|
3010
3010
|
const idToHref = /* @__PURE__ */ new Map();
|
|
3011
3011
|
for (let i = 0; i < items.length; i++) {
|
|
3012
3012
|
const item = items[i];
|
|
3013
3013
|
const id = item.getAttribute("id") || "";
|
|
3014
|
-
const href =
|
|
3014
|
+
const href = _chunkVQB5P5KJcjs.normalizeSectionHref.call(void 0, item.getAttribute("href") || "");
|
|
3015
3015
|
if (id && href) idToHref.set(id, href);
|
|
3016
3016
|
}
|
|
3017
3017
|
if (spine.length > 0) {
|
|
@@ -3022,7 +3022,7 @@ function parseSectionPathsFromManifest(xml) {
|
|
|
3022
3022
|
}
|
|
3023
3023
|
if (ordered.length > 0) return ordered;
|
|
3024
3024
|
}
|
|
3025
|
-
return Array.from(idToHref.values()).sort(
|
|
3025
|
+
return Array.from(idToHref.values()).sort(_chunkVQB5P5KJcjs.compareSectionPaths);
|
|
3026
3026
|
}
|
|
3027
3027
|
|
|
3028
3028
|
// src/hwpx/metadata.ts
|
|
@@ -3035,7 +3035,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3035
3035
|
const xml = await file.async("text");
|
|
3036
3036
|
if (decompressed) {
|
|
3037
3037
|
decompressed.total += xml.length * 2;
|
|
3038
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3038
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3039
3039
|
}
|
|
3040
3040
|
parseDublinCoreMetadata(xml, metadata);
|
|
3041
3041
|
if (metadata.title || metadata.author) return;
|
|
@@ -3045,7 +3045,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3045
3045
|
}
|
|
3046
3046
|
function parseDublinCoreMetadata(xml, metadata) {
|
|
3047
3047
|
const parser = createXmlParser();
|
|
3048
|
-
const doc = parser.parseFromString(
|
|
3048
|
+
const doc = parser.parseFromString(_chunkVQB5P5KJcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3049
3049
|
if (!doc.documentElement) return;
|
|
3050
3050
|
const getText = (tagNames) => {
|
|
3051
3051
|
for (const tag of tagNames) {
|
|
@@ -3070,7 +3070,7 @@ function parseDublinCoreMetadata(xml, metadata) {
|
|
|
3070
3070
|
|
|
3071
3071
|
// src/hwpx/parser.ts
|
|
3072
3072
|
async function parseHwpxDocument(buffer, options) {
|
|
3073
|
-
|
|
3073
|
+
_chunkVQB5P5KJcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
3074
3074
|
let zip;
|
|
3075
3075
|
try {
|
|
3076
3076
|
zip = await _jszip2.default.loadAsync(buffer);
|
|
@@ -3079,7 +3079,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3079
3079
|
}
|
|
3080
3080
|
const actualEntryCount = Object.keys(zip.files).length;
|
|
3081
3081
|
if (actualEntryCount > MAX_ZIP_ENTRIES) {
|
|
3082
|
-
throw new (0,
|
|
3082
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3083
3083
|
}
|
|
3084
3084
|
const manifestFile = zip.file("META-INF/manifest.xml");
|
|
3085
3085
|
if (manifestFile) {
|
|
@@ -3091,7 +3091,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3091
3091
|
return comResultToParseResult(pages, pageCount, warnings2);
|
|
3092
3092
|
}
|
|
3093
3093
|
}
|
|
3094
|
-
throw new (0,
|
|
3094
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("DRM \uC554\uD638\uD654\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4. Windows + \uD55C\uCEF4 \uC624\uD53C\uC2A4 \uC124\uCE58 \uC2DC \uC790\uB3D9 \uCD94\uCD9C\uB429\uB2C8\uB2E4.");
|
|
3095
3095
|
}
|
|
3096
3096
|
}
|
|
3097
3097
|
const decompressed = { total: 0 };
|
|
@@ -3100,7 +3100,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3100
3100
|
const styleMap = await extractHwpxStyles(zip, decompressed);
|
|
3101
3101
|
const warnings = [];
|
|
3102
3102
|
const sectionPaths = await resolveSectionPaths(zip);
|
|
3103
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
3103
|
+
if (sectionPaths.length === 0) throw new (0, _chunkVQB5P5KJcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
3104
3104
|
metadata.pageCount = sectionPaths.length;
|
|
3105
3105
|
const pageFilter = _optionalChain([options, 'optionalAccess', _87 => _87.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sectionPaths.length) : null;
|
|
3106
3106
|
const totalTarget = pageFilter ? pageFilter.size : sectionPaths.length;
|
|
@@ -3130,7 +3130,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3130
3130
|
const images = await extractImagesFromZip(zip, blocks, decompressed, warnings, !pageFilter);
|
|
3131
3131
|
detectHwpxHeadings(blocks, styleMap);
|
|
3132
3132
|
const outline = blocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
3133
|
-
const markdown =
|
|
3133
|
+
const markdown = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, blocks);
|
|
3134
3134
|
return { markdown, blocks, metadata, outline: outline.length > 0 ? outline : void 0, warnings: warnings.length > 0 ? warnings : void 0, images: images.length > 0 ? images : void 0 };
|
|
3135
3135
|
}
|
|
3136
3136
|
|
|
@@ -4147,7 +4147,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
4147
4147
|
lenientCfb = parseLenientCfb(buffer);
|
|
4148
4148
|
warnings.push({ message: "\uC190\uC0C1\uB41C CFB \uCEE8\uD14C\uC774\uB108 \u2014 lenient \uBAA8\uB4DC\uB85C \uBCF5\uAD6C", code: "LENIENT_CFB_RECOVERY" });
|
|
4149
4149
|
} catch (e22) {
|
|
4150
|
-
throw new (0,
|
|
4150
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
|
|
4151
4151
|
}
|
|
4152
4152
|
}
|
|
4153
4153
|
const findStream = (path) => {
|
|
@@ -4158,11 +4158,11 @@ function parseHwp5Document(buffer, options) {
|
|
|
4158
4158
|
return lenientCfb.findStream(path);
|
|
4159
4159
|
};
|
|
4160
4160
|
const headerData = findStream("/FileHeader");
|
|
4161
|
-
if (!headerData) throw new (0,
|
|
4161
|
+
if (!headerData) throw new (0, _chunkVQB5P5KJcjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
4162
4162
|
const header = parseFileHeader(headerData);
|
|
4163
|
-
if (header.signature !== "HWP Document File") throw new (0,
|
|
4164
|
-
if (header.flags & FLAG_ENCRYPTED) throw new (0,
|
|
4165
|
-
if (header.flags & FLAG_DRM) throw new (0,
|
|
4163
|
+
if (header.signature !== "HWP Document File") throw new (0, _chunkVQB5P5KJcjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
4164
|
+
if (header.flags & FLAG_ENCRYPTED) throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uC554\uD638\uD654\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
4165
|
+
if (header.flags & FLAG_DRM) throw new (0, _chunkVQB5P5KJcjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
4166
4166
|
const compressed = (header.flags & FLAG_COMPRESSED) !== 0;
|
|
4167
4167
|
const distribution = (header.flags & FLAG_DISTRIBUTION) !== 0;
|
|
4168
4168
|
const metadata = {
|
|
@@ -4171,7 +4171,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
4171
4171
|
if (cfb) extractHwp5Metadata(cfb, metadata);
|
|
4172
4172
|
const docInfo = cfb ? parseDocInfoStream(cfb, compressed) : parseDocInfoFromStream(findStream("/DocInfo"), compressed);
|
|
4173
4173
|
const sections = distribution ? cfb ? findViewTextSections(cfb, compressed) : findViewTextSectionsLenient(lenientCfb, compressed) : cfb ? findSections(cfb) : findSectionsLenient(lenientCfb, compressed);
|
|
4174
|
-
if (sections.length === 0) throw new (0,
|
|
4174
|
+
if (sections.length === 0) throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
4175
4175
|
metadata.pageCount = sections.length;
|
|
4176
4176
|
const pageFilter = _optionalChain([options, 'optionalAccess', _93 => _93.pages]) ? _chunkDCZVOIEOcjs.parsePageRange.call(void 0, options.pages, sections.length) : null;
|
|
4177
4177
|
const totalTarget = pageFilter ? pageFilter.size : sections.length;
|
|
@@ -4186,22 +4186,22 @@ function parseHwp5Document(buffer, options) {
|
|
|
4186
4186
|
const sectionData = sections[si];
|
|
4187
4187
|
const data = !distribution && compressed ? decompressStream(Buffer.from(sectionData)) : Buffer.from(sectionData);
|
|
4188
4188
|
totalDecompressed += data.length;
|
|
4189
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4189
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4190
4190
|
const records = readRecords(data);
|
|
4191
4191
|
const sectionBlocks = parseSection(records, docInfo, warnings, si + 1, doc);
|
|
4192
4192
|
bodyBlocks.push(...sectionBlocks);
|
|
4193
4193
|
parsedSections++;
|
|
4194
4194
|
_optionalChain([options, 'optionalAccess', _95 => _95.onProgress, 'optionalCall', _96 => _96(parsedSections, totalTarget)]);
|
|
4195
4195
|
} catch (secErr) {
|
|
4196
|
-
if (secErr instanceof
|
|
4196
|
+
if (secErr instanceof _chunkVQB5P5KJcjs.KordocError) throw secErr;
|
|
4197
4197
|
warnings.push({ page: si + 1, message: `\uC139\uC158 ${si + 1} \uD30C\uC2F1 \uC2E4\uD328: ${secErr instanceof Error ? secErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
|
|
4198
4198
|
}
|
|
4199
4199
|
}
|
|
4200
4200
|
const blocks = [...doc.headerBlocks, ...bodyBlocks, ...doc.footerBlocks];
|
|
4201
4201
|
const images = cfb ? extractHwp5Images(cfb.FileIndex, blocks, warnings, !pageFilter) : extractHwp5ImagesLenient(lenientCfb, blocks, warnings, !pageFilter);
|
|
4202
|
-
let flatBlocks =
|
|
4202
|
+
let flatBlocks = _chunkZMKTKJZNcjs.flattenLayoutTables.call(void 0, blocks);
|
|
4203
4203
|
if (_optionalChain([options, 'optionalAccess', _97 => _97.dedupeRunningHeaders])) {
|
|
4204
|
-
const deduped =
|
|
4204
|
+
const deduped = _chunkZMKTKJZNcjs.dedupeRunningHeaders.call(void 0, flatBlocks);
|
|
4205
4205
|
const removed = flatBlocks.length - deduped.length;
|
|
4206
4206
|
if (removed > 0) warnings.push({ message: `\uBC18\uBCF5 \uB7EC\uB2DD \uD5E4\uB354 ${removed}\uAC1C \uC81C\uAC70`, code: "HIDDEN_TEXT_FILTERED" });
|
|
4207
4207
|
flatBlocks = deduped;
|
|
@@ -4210,10 +4210,10 @@ function parseHwp5Document(buffer, options) {
|
|
|
4210
4210
|
detectHwp5Headings(flatBlocks, docInfo);
|
|
4211
4211
|
}
|
|
4212
4212
|
const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
4213
|
-
let markdown =
|
|
4213
|
+
let markdown = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, flatBlocks);
|
|
4214
4214
|
if (_optionalChain([options, 'optionalAccess', _98 => _98.inlineImages]) && images.length > 0) {
|
|
4215
4215
|
try {
|
|
4216
|
-
markdown =
|
|
4216
|
+
markdown = _chunkZMKTKJZNcjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
|
|
4217
4217
|
} catch (inlineErr) {
|
|
4218
4218
|
warnings.push({ message: `\uC774\uBBF8\uC9C0 \uC778\uB77C\uC778 \uC2E4\uD328 \u2014 \uC6D0\uBCF8 \uD30C\uC77C \uCC38\uC870\uB85C \uD3F4\uBC31: ${inlineErr instanceof Error ? inlineErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "SKIPPED_IMAGE" });
|
|
4219
4219
|
}
|
|
@@ -4277,9 +4277,9 @@ function detectHwp5Headings(blocks, docInfo) {
|
|
|
4277
4277
|
let level = 0;
|
|
4278
4278
|
if (_optionalChain([block, 'access', _103 => _103.style, 'optionalAccess', _104 => _104.fontSize]) && baseFontSize > 0) {
|
|
4279
4279
|
const ratio = block.style.fontSize / baseFontSize;
|
|
4280
|
-
if (ratio >=
|
|
4281
|
-
else if (ratio >=
|
|
4282
|
-
else if (ratio >=
|
|
4280
|
+
if (ratio >= _chunkVQB5P5KJcjs.HEADING_RATIO_H1) level = 1;
|
|
4281
|
+
else if (ratio >= _chunkVQB5P5KJcjs.HEADING_RATIO_H2) level = 2;
|
|
4282
|
+
else if (ratio >= _chunkVQB5P5KJcjs.HEADING_RATIO_H3) level = 3;
|
|
4283
4283
|
}
|
|
4284
4284
|
if (/^제\d+[장절편]\s/.test(text) && text.length <= 50) {
|
|
4285
4285
|
if (level === 0) level = 2;
|
|
@@ -4364,7 +4364,7 @@ function findSectionsLenient(lcfb, compressed) {
|
|
|
4364
4364
|
if (!raw) break;
|
|
4365
4365
|
const content = compressed ? decompressStream(raw) : raw;
|
|
4366
4366
|
totalDecompressed += content.length;
|
|
4367
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4367
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4368
4368
|
sections.push({ idx: i, content });
|
|
4369
4369
|
}
|
|
4370
4370
|
if (sections.length === 0) {
|
|
@@ -4376,7 +4376,7 @@ function findSectionsLenient(lcfb, compressed) {
|
|
|
4376
4376
|
if (raw) {
|
|
4377
4377
|
const content = compressed ? decompressStream(raw) : raw;
|
|
4378
4378
|
totalDecompressed += content.length;
|
|
4379
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4379
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4380
4380
|
sections.push({ idx, content });
|
|
4381
4381
|
}
|
|
4382
4382
|
}
|
|
@@ -4393,7 +4393,7 @@ function findViewTextSectionsLenient(lcfb, compressed) {
|
|
|
4393
4393
|
try {
|
|
4394
4394
|
const content = decryptViewText(raw, compressed);
|
|
4395
4395
|
totalDecompressed += content.length;
|
|
4396
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
4396
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
4397
4397
|
sections.push({ idx: i, content });
|
|
4398
4398
|
} catch (e27) {
|
|
4399
4399
|
break;
|
|
@@ -4496,7 +4496,7 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
4496
4496
|
const ctrl = ctrls[r.ctrlIdx];
|
|
4497
4497
|
if (!_optionalChain([ctrl, 'optionalAccess', _111 => _111.href]) || r.end <= r.start) continue;
|
|
4498
4498
|
if (applied.some(([s, e]) => r.start < e && r.end > s)) continue;
|
|
4499
|
-
const href =
|
|
4499
|
+
const href = _chunkVQB5P5KJcjs.sanitizeHref.call(void 0, ctrl.href);
|
|
4500
4500
|
if (!href) continue;
|
|
4501
4501
|
const anchor = text.slice(r.start, r.end);
|
|
4502
4502
|
if (!anchor.trim()) continue;
|
|
@@ -4732,8 +4732,8 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
4732
4732
|
let tableIdx = -1;
|
|
4733
4733
|
for (let i2 = childStart; i2 < childEnd; i2++) {
|
|
4734
4734
|
if (records[i2].tagId === TAG_TABLE && records[i2].data.length >= 8) {
|
|
4735
|
-
rows = Math.min(records[i2].data.readUInt16LE(4),
|
|
4736
|
-
cols = Math.min(records[i2].data.readUInt16LE(6),
|
|
4735
|
+
rows = Math.min(records[i2].data.readUInt16LE(4), _chunkZMKTKJZNcjs.MAX_ROWS);
|
|
4736
|
+
cols = Math.min(records[i2].data.readUInt16LE(6), _chunkZMKTKJZNcjs.MAX_COLS);
|
|
4737
4737
|
tableIdx = i2;
|
|
4738
4738
|
break;
|
|
4739
4739
|
}
|
|
@@ -4782,7 +4782,7 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
4782
4782
|
return table3;
|
|
4783
4783
|
}
|
|
4784
4784
|
const cellRows = arrangeCells(rows, cols, cells);
|
|
4785
|
-
const table2 =
|
|
4785
|
+
const table2 = _chunkZMKTKJZNcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: ctx.doc.keepTrailingEmptyCols });
|
|
4786
4786
|
if (caption && table2.rows > 0) table2.caption = caption;
|
|
4787
4787
|
return table2.rows > 0 ? table2 : null;
|
|
4788
4788
|
}
|
|
@@ -4799,8 +4799,8 @@ function parseCell(records, lhIdx, end, ctx) {
|
|
|
4799
4799
|
rowAddr = rec.data.readUInt16LE(10);
|
|
4800
4800
|
const cs = rec.data.readUInt16LE(12);
|
|
4801
4801
|
const rs = rec.data.readUInt16LE(14);
|
|
4802
|
-
if (cs > 0) colSpan = Math.min(cs,
|
|
4803
|
-
if (rs > 0) rowSpan = Math.min(rs,
|
|
4802
|
+
if (cs > 0) colSpan = Math.min(cs, _chunkZMKTKJZNcjs.MAX_COLS);
|
|
4803
|
+
if (rs > 0) rowSpan = Math.min(rs, _chunkZMKTKJZNcjs.MAX_ROWS);
|
|
4804
4804
|
}
|
|
4805
4805
|
const blocks = ctx.depth < MAX_NEST_DEPTH ? parseParagraphList(records, lhIdx + 1, end, { ...ctx, depth: ctx.depth + 1 }) : [];
|
|
4806
4806
|
const parts = [];
|
|
@@ -4810,7 +4810,7 @@ function parseCell(records, lhIdx, end, ctx) {
|
|
|
4810
4810
|
parts.push(``);
|
|
4811
4811
|
hasStructure = true;
|
|
4812
4812
|
} else if (b.type === "table" && b.table) {
|
|
4813
|
-
const flat =
|
|
4813
|
+
const flat = _chunkZMKTKJZNcjs.convertTableToText.call(void 0, b.table.cells);
|
|
4814
4814
|
if (flat) parts.push(flat);
|
|
4815
4815
|
hasStructure = true;
|
|
4816
4816
|
} else if (b.text) {
|
|
@@ -17048,7 +17048,7 @@ function parseHwp3Document(buffer, _options) {
|
|
|
17048
17048
|
const headReader = new Reader(Buffer.from(buffer));
|
|
17049
17049
|
const header = readHeader(headReader);
|
|
17050
17050
|
if (header.encrypted !== 0) {
|
|
17051
|
-
throw new (0,
|
|
17051
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uC554\uD638\uD654\uB41C HWP3 \uBB38\uC11C \u2014 \uBCF8\uBB38\uC774 \uC554\uD638\uB85C \uBCF4\uD638\uB418\uC5B4 \uC788\uC5B4 \uCD94\uCD9C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
17052
17052
|
}
|
|
17053
17053
|
headReader.skip(header.infoBlockLength);
|
|
17054
17054
|
const tail = headReader.readToEnd();
|
|
@@ -17059,10 +17059,10 @@ function parseHwp3Document(buffer, _options) {
|
|
|
17059
17059
|
body = _zlib.inflateRawSync.call(void 0, tail, { maxOutputLength: MAX_DECOMPRESS_SIZE3 });
|
|
17060
17060
|
} catch (err) {
|
|
17061
17061
|
if (_optionalChain([err, 'optionalAccess', _124 => _124.code]) === "ERR_BUFFER_TOO_LARGE") {
|
|
17062
|
-
throw new (0,
|
|
17062
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(`HWP3 \uC555\uCD95 \uD574\uC81C \uACB0\uACFC\uAC00 \uCD5C\uB300 \uD5C8\uC6A9 \uD06C\uAE30(${MAX_DECOMPRESS_SIZE3 / 1024 / 1024}MB)\uB97C \uCD08\uACFC\uD588\uC2B5\uB2C8\uB2E4`);
|
|
17063
17063
|
}
|
|
17064
17064
|
const msg2 = err instanceof Error ? err.message : String(err);
|
|
17065
|
-
throw new (0,
|
|
17065
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(`HWP3 \uC555\uCD95 \uD574\uC81C \uC2E4\uD328: ${msg2}`);
|
|
17066
17066
|
}
|
|
17067
17067
|
} else {
|
|
17068
17068
|
body = tail;
|
|
@@ -17304,7 +17304,7 @@ function getTextContent(el) {
|
|
|
17304
17304
|
return _nullishCoalesce(_optionalChain([el, 'access', _127 => _127.textContent, 'optionalAccess', _128 => _128.trim, 'call', _129 => _129()]), () => ( ""));
|
|
17305
17305
|
}
|
|
17306
17306
|
function parseXml(text) {
|
|
17307
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
17307
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunkVQB5P5KJcjs.stripDtd.call(void 0, text), "text/xml");
|
|
17308
17308
|
}
|
|
17309
17309
|
function collectRichText(root) {
|
|
17310
17310
|
let out = "";
|
|
@@ -17539,7 +17539,7 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex, keep
|
|
|
17539
17539
|
cellRows.push(row);
|
|
17540
17540
|
}
|
|
17541
17541
|
if (cellRows.length > 0) {
|
|
17542
|
-
const table2 =
|
|
17542
|
+
const table2 = _chunkZMKTKJZNcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
|
|
17543
17543
|
if (table2.rows > 0) {
|
|
17544
17544
|
blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
|
|
17545
17545
|
}
|
|
@@ -17547,12 +17547,12 @@ function sheetToBlocks(sheetName, grid, merges, maxRow, maxCol, sheetIndex, keep
|
|
|
17547
17547
|
return blocks;
|
|
17548
17548
|
}
|
|
17549
17549
|
async function parseXlsxDocument(buffer, options) {
|
|
17550
|
-
|
|
17550
|
+
_chunkVQB5P5KJcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
|
|
17551
17551
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
17552
17552
|
const warnings = [];
|
|
17553
17553
|
const workbookFile = zip.file("xl/workbook.xml");
|
|
17554
17554
|
if (!workbookFile) {
|
|
17555
|
-
throw new (0,
|
|
17555
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
17556
17556
|
}
|
|
17557
17557
|
let sharedStrings = [];
|
|
17558
17558
|
const ssFile = zip.file("xl/sharedStrings.xml");
|
|
@@ -17561,7 +17561,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
17561
17561
|
}
|
|
17562
17562
|
const { sheets, date1904 } = parseWorkbook(await workbookFile.async("text"));
|
|
17563
17563
|
if (sheets.length === 0) {
|
|
17564
|
-
throw new (0,
|
|
17564
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
17565
17565
|
}
|
|
17566
17566
|
let dateXfs = /* @__PURE__ */ new Map();
|
|
17567
17567
|
const stylesFile = zip.file("xl/styles.xml");
|
|
@@ -17645,7 +17645,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
17645
17645
|
} catch (e29) {
|
|
17646
17646
|
}
|
|
17647
17647
|
}
|
|
17648
|
-
const markdown =
|
|
17648
|
+
const markdown = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, blocks);
|
|
17649
17649
|
return { markdown, blocks, metadata, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
17650
17650
|
}
|
|
17651
17651
|
|
|
@@ -18096,11 +18096,11 @@ function processGlobals(records) {
|
|
|
18096
18096
|
const xfFmtIds = [];
|
|
18097
18097
|
const firstBof = records[0];
|
|
18098
18098
|
if (!firstBof || firstBof.opcode !== OP_BOF) {
|
|
18099
|
-
throw new (0,
|
|
18099
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
|
|
18100
18100
|
}
|
|
18101
18101
|
const bof = decodeBof(firstBof.data);
|
|
18102
18102
|
if (!bof || bof.dt !== DT_GLOBALS) {
|
|
18103
|
-
throw new (0,
|
|
18103
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
|
|
18104
18104
|
}
|
|
18105
18105
|
let i = 1;
|
|
18106
18106
|
while (i < records.length) {
|
|
@@ -18235,7 +18235,7 @@ function sheetToBlocks2(sheetName, sheet, sheetIndex, keepAnchoredEmptyCols) {
|
|
|
18235
18235
|
cellRows.push(row);
|
|
18236
18236
|
}
|
|
18237
18237
|
if (cellRows.length > 0) {
|
|
18238
|
-
const table2 =
|
|
18238
|
+
const table2 = _chunkZMKTKJZNcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols });
|
|
18239
18239
|
if (table2.rows > 0) {
|
|
18240
18240
|
blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
|
|
18241
18241
|
}
|
|
@@ -18248,28 +18248,28 @@ async function parseXlsDocument(buffer, options) {
|
|
|
18248
18248
|
try {
|
|
18249
18249
|
cfb = parseLenientCfb(buf);
|
|
18250
18250
|
} catch (e) {
|
|
18251
|
-
throw new (0,
|
|
18251
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(
|
|
18252
18252
|
`XLS: OLE2 \uC2DC\uADF8\uB2C8\uCC98 \uAC80\uC99D \uC2E4\uD328 \u2014 ${e instanceof Error ? e.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`
|
|
18253
18253
|
);
|
|
18254
18254
|
}
|
|
18255
18255
|
const wb = _nullishCoalesce(cfb.findStream("/Workbook"), () => ( cfb.findStream("/Book")));
|
|
18256
18256
|
if (!wb) {
|
|
18257
|
-
throw new (0,
|
|
18257
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
|
|
18258
18258
|
}
|
|
18259
18259
|
const records = readRecords2(wb);
|
|
18260
18260
|
if (records.length === 0) {
|
|
18261
|
-
throw new (0,
|
|
18261
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
|
|
18262
18262
|
}
|
|
18263
18263
|
const firstBof = decodeBof(records[0].data);
|
|
18264
18264
|
if (firstBof && firstBof.vers !== 1536) {
|
|
18265
|
-
throw new (0,
|
|
18265
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(
|
|
18266
18266
|
`XLS: BIFF8(0x0600)\uB9CC \uC9C0\uC6D0 \u2014 \uBCF8 \uD30C\uC77C\uC740 0x${firstBof.vers.toString(16)}`
|
|
18267
18267
|
);
|
|
18268
18268
|
}
|
|
18269
18269
|
const globals = processGlobals(records);
|
|
18270
18270
|
const warnings = [];
|
|
18271
18271
|
if (globals.encrypted) {
|
|
18272
|
-
throw new (0,
|
|
18272
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("XLS \uD30C\uC77C\uC774 \uC554\uD638\uD654\uB418\uC5B4 \uC788\uC5B4 \uD30C\uC2F1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
18273
18273
|
}
|
|
18274
18274
|
const convertNum = globals.dateXfs.size > 0 ? (n, ixfe) => {
|
|
18275
18275
|
const kind = globals.dateXfs.get(ixfe);
|
|
@@ -18320,7 +18320,7 @@ async function parseXlsDocument(buffer, options) {
|
|
|
18320
18320
|
pageCount: totalSheets
|
|
18321
18321
|
};
|
|
18322
18322
|
return {
|
|
18323
|
-
markdown:
|
|
18323
|
+
markdown: _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, allBlocks),
|
|
18324
18324
|
blocks: allBlocks,
|
|
18325
18325
|
metadata,
|
|
18326
18326
|
warnings: warnings.length > 0 ? warnings : void 0
|
|
@@ -18748,7 +18748,7 @@ function getAttr(el, localName2) {
|
|
|
18748
18748
|
return null;
|
|
18749
18749
|
}
|
|
18750
18750
|
function parseXml2(text) {
|
|
18751
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
18751
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunkVQB5P5KJcjs.stripDtd.call(void 0, text), "text/xml");
|
|
18752
18752
|
}
|
|
18753
18753
|
function parseStyles(xml) {
|
|
18754
18754
|
const doc = parseXml2(xml);
|
|
@@ -18906,7 +18906,7 @@ function fieldUrlFromInstr(instr) {
|
|
|
18906
18906
|
function makeLink(text, rawHref) {
|
|
18907
18907
|
if (!text) return "";
|
|
18908
18908
|
if (!rawHref) return text;
|
|
18909
|
-
const href =
|
|
18909
|
+
const href = _chunkVQB5P5KJcjs.sanitizeHref.call(void 0, rawHref);
|
|
18910
18910
|
return href ? `[${text}](${href})` : text;
|
|
18911
18911
|
}
|
|
18912
18912
|
function collectInline(p, footnotes, rels) {
|
|
@@ -19100,7 +19100,7 @@ ${cell2.text}` : cell2.text;
|
|
|
19100
19100
|
return { text: cell2.text, colSpan: cell2.colSpan, rowSpan, colAddr: cell2.col, rowAddr: r };
|
|
19101
19101
|
})
|
|
19102
19102
|
);
|
|
19103
|
-
const table2 =
|
|
19103
|
+
const table2 = _chunkZMKTKJZNcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keepEmptyCols });
|
|
19104
19104
|
if (table2.rows === 0 || table2.cols === 0) return null;
|
|
19105
19105
|
return { type: "table", table: table2 };
|
|
19106
19106
|
}
|
|
@@ -19202,12 +19202,12 @@ function emitParagraphImages(p, imageMap, linked, out) {
|
|
|
19202
19202
|
}
|
|
19203
19203
|
}
|
|
19204
19204
|
async function parseDocxDocument(buffer, options) {
|
|
19205
|
-
|
|
19205
|
+
_chunkVQB5P5KJcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE5);
|
|
19206
19206
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
19207
19207
|
const warnings = [];
|
|
19208
19208
|
const docFile = zip.file("word/document.xml");
|
|
19209
19209
|
if (!docFile) {
|
|
19210
|
-
throw new (0,
|
|
19210
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19211
19211
|
}
|
|
19212
19212
|
let rels = /* @__PURE__ */ new Map();
|
|
19213
19213
|
const relsFile = zip.file("word/_rels/document.xml.rels");
|
|
@@ -19254,7 +19254,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
19254
19254
|
const doc = parseXml2(docXml);
|
|
19255
19255
|
const body = findElements(doc, "body");
|
|
19256
19256
|
if (body.length === 0) {
|
|
19257
|
-
throw new (0,
|
|
19257
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19258
19258
|
}
|
|
19259
19259
|
const { imageMap, images } = await buildImageMap(zip, rels, doc, warnings);
|
|
19260
19260
|
const linkedImages = /* @__PURE__ */ new Set();
|
|
@@ -19305,7 +19305,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
19305
19305
|
}
|
|
19306
19306
|
}
|
|
19307
19307
|
const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")) }));
|
|
19308
|
-
const markdown =
|
|
19308
|
+
const markdown = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, blocks);
|
|
19309
19309
|
return {
|
|
19310
19310
|
markdown,
|
|
19311
19311
|
blocks,
|
|
@@ -19323,11 +19323,11 @@ var MAX_TABLE_COLS = 500;
|
|
|
19323
19323
|
var MAX_HWPML_BYTES = 50 * 1024 * 1024;
|
|
19324
19324
|
function parseHwpmlDocument(buffer, options) {
|
|
19325
19325
|
if (buffer.byteLength > MAX_HWPML_BYTES) {
|
|
19326
|
-
throw new (0,
|
|
19326
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(`HWPML \uD30C\uC77C \uD06C\uAE30 \uCD08\uACFC (${(buffer.byteLength / 1024 / 1024).toFixed(1)}MB > 50MB)`);
|
|
19327
19327
|
}
|
|
19328
19328
|
const text = new TextDecoder("utf-8").decode(buffer).replace(/^\uFEFF/, "");
|
|
19329
19329
|
const normalized = text.replace(/ /g, " ");
|
|
19330
|
-
const xml =
|
|
19330
|
+
const xml = _chunkVQB5P5KJcjs.stripDtd.call(void 0, normalized);
|
|
19331
19331
|
const warnings = [];
|
|
19332
19332
|
const parser = new (0, _xmldom.DOMParser)({
|
|
19333
19333
|
onError: (_level, msg2) => {
|
|
@@ -19367,7 +19367,7 @@ function parseHwpmlDocument(buffer, options) {
|
|
|
19367
19367
|
parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _173 => _173.keepTrailingEmptyCols]), () => ( false)));
|
|
19368
19368
|
}
|
|
19369
19369
|
const outline = blocks.filter((b) => b.type === "heading" && b.text).map((b) => ({ level: _nullishCoalesce(b.level, () => ( 1)), text: b.text, pageNumber: b.pageNumber }));
|
|
19370
|
-
const markdown =
|
|
19370
|
+
const markdown = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, blocks);
|
|
19371
19371
|
return {
|
|
19372
19372
|
markdown,
|
|
19373
19373
|
blocks,
|
|
@@ -19532,7 +19532,7 @@ function buildHmlTable(el, warnings, keep, tableDepth) {
|
|
|
19532
19532
|
const r = Math.min(Math.max(_nullishCoalesce(cell2.rowAddr, () => ( 0)), 0), rowCount - 1);
|
|
19533
19533
|
cellRows[r].push(cell2);
|
|
19534
19534
|
}
|
|
19535
|
-
const table2 =
|
|
19535
|
+
const table2 = _chunkZMKTKJZNcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keep });
|
|
19536
19536
|
if (structured.length > 0) {
|
|
19537
19537
|
const claimed = /* @__PURE__ */ new Set();
|
|
19538
19538
|
for (const { ctx, cellBlocks } of structured) {
|
|
@@ -21088,19 +21088,19 @@ function parseCentralDirectory(buf) {
|
|
|
21088
21088
|
}
|
|
21089
21089
|
}
|
|
21090
21090
|
}
|
|
21091
|
-
if (eocdOffset < 0) throw new (0,
|
|
21091
|
+
if (eocdOffset < 0) throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21092
21092
|
const totalEntries = view.getUint16(eocdOffset + 10, true);
|
|
21093
21093
|
const cdSize = view.getUint32(eocdOffset + 12, true);
|
|
21094
21094
|
const cdOffset = view.getUint32(eocdOffset + 16, true);
|
|
21095
|
-
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0,
|
|
21095
|
+
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
21096
21096
|
if (eocdOffset >= 20 && view.getUint32(eocdOffset - 20, true) === ZIP64_EOCD_LOC_SIG) {
|
|
21097
|
-
throw new (0,
|
|
21097
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
21098
21098
|
}
|
|
21099
21099
|
const decoder = new TextDecoder("utf-8");
|
|
21100
21100
|
const entries = [];
|
|
21101
21101
|
let pos = cdOffset;
|
|
21102
21102
|
for (let i = 0; i < totalEntries; i++) {
|
|
21103
|
-
if (view.getUint32(pos, true) !== CD_SIG) throw new (0,
|
|
21103
|
+
if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
|
|
21104
21104
|
const flags = view.getUint16(pos + 8, true);
|
|
21105
21105
|
const method = view.getUint16(pos + 10, true);
|
|
21106
21106
|
const crc = view.getUint32(pos + 16, true);
|
|
@@ -21111,7 +21111,7 @@ function parseCentralDirectory(buf) {
|
|
|
21111
21111
|
const commentLen = view.getUint16(pos + 32, true);
|
|
21112
21112
|
const localOffset = view.getUint32(pos + 42, true);
|
|
21113
21113
|
if (compSize === 4294967295 || uncompSize === 4294967295 || localOffset === 4294967295) {
|
|
21114
|
-
throw new (0,
|
|
21114
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
21115
21115
|
}
|
|
21116
21116
|
const name = decoder.decode(buf.subarray(pos + 46, pos + 46 + nameLen));
|
|
21117
21117
|
const cdEnd = pos + 46 + nameLen + extraLen + commentLen;
|
|
@@ -21140,11 +21140,11 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21140
21140
|
const { entries, cdOffset, eocdOffset } = parseCentralDirectory(original);
|
|
21141
21141
|
const view = new DataView(original.buffer, original.byteOffset, original.byteLength);
|
|
21142
21142
|
for (const name of replacements.keys()) {
|
|
21143
|
-
if (!entries.some((e) => e.name === name)) throw new (0,
|
|
21143
|
+
if (!entries.some((e) => e.name === name)) throw new (0, _chunkVQB5P5KJcjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
21144
21144
|
}
|
|
21145
21145
|
if (additions) {
|
|
21146
21146
|
for (const name of additions.keys()) {
|
|
21147
|
-
if (entries.some((e) => e.name === name)) throw new (0,
|
|
21147
|
+
if (entries.some((e) => e.name === name)) throw new (0, _chunkVQB5P5KJcjs.KordocError)(`ZIP\uC5D0 \uC774\uBBF8 \uC788\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
21148
21148
|
}
|
|
21149
21149
|
}
|
|
21150
21150
|
const byLocal = [...entries].sort((a, b) => a.localOffset - b.localOffset);
|
|
@@ -21163,7 +21163,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21163
21163
|
offset += seg.length;
|
|
21164
21164
|
continue;
|
|
21165
21165
|
}
|
|
21166
|
-
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0,
|
|
21166
|
+
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkVQB5P5KJcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
21167
21167
|
const nameLen = view.getUint16(e.localOffset + 26, true);
|
|
21168
21168
|
const extraLen = view.getUint16(e.localOffset + 28, true);
|
|
21169
21169
|
const headerLen = 30 + nameLen + extraLen;
|
|
@@ -21171,7 +21171,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
21171
21171
|
const hview = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
21172
21172
|
const method = e.method;
|
|
21173
21173
|
if (method !== 0 && method !== 8) {
|
|
21174
|
-
throw new (0,
|
|
21174
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 ZIP \uC555\uCD95 \uBC29\uC2DD(method=${method}): ${e.name} \u2014 STORE(0)/DEFLATE(8)\uB9CC \uAD50\uCCB4 \uAC00\uB2A5`);
|
|
21175
21175
|
}
|
|
21176
21176
|
const compData = method === 0 ? newData : new Uint8Array(_zlib.deflateRawSync.call(void 0, newData));
|
|
21177
21177
|
const crc = crc32(newData);
|
|
@@ -21272,7 +21272,7 @@ async function fillHwpx(hwpxBuffer, values, blockedLabels) {
|
|
|
21272
21272
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
21273
21273
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
|
|
21274
21274
|
if (sectionPaths.length === 0) {
|
|
21275
|
-
throw new (0,
|
|
21275
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21276
21276
|
}
|
|
21277
21277
|
const warnings = [];
|
|
21278
21278
|
const normalizedValues = normalizeValues(values, warnings);
|
|
@@ -22014,7 +22014,7 @@ function needsGaejosikAssets(gongmun) {
|
|
|
22014
22014
|
}
|
|
22015
22015
|
function assertFiniteRange(name, value, min, max) {
|
|
22016
22016
|
if (!Number.isFinite(value) || value < min || value > max) {
|
|
22017
|
-
throw new (0,
|
|
22017
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(`${name} must be a finite number between ${min} and ${max}`);
|
|
22018
22018
|
}
|
|
22019
22019
|
}
|
|
22020
22020
|
function validateGongmunOptions(opts) {
|
|
@@ -22029,10 +22029,10 @@ function validateGongmunOptions(opts) {
|
|
|
22029
22029
|
assertFiniteRange(`margins.${side}`, value, 0, 200);
|
|
22030
22030
|
}
|
|
22031
22031
|
if (opts.margins.left + opts.margins.right >= 210) {
|
|
22032
|
-
throw new (0,
|
|
22032
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("margins.left + margins.right must be less than 210");
|
|
22033
22033
|
}
|
|
22034
22034
|
if (opts.margins.top + opts.margins.bottom >= 297) {
|
|
22035
|
-
throw new (0,
|
|
22035
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("margins.top + margins.bottom must be less than 297");
|
|
22036
22036
|
}
|
|
22037
22037
|
}
|
|
22038
22038
|
if (opts.sizes) {
|
|
@@ -22041,7 +22041,7 @@ function validateGongmunOptions(opts) {
|
|
|
22041
22041
|
}
|
|
22042
22042
|
}
|
|
22043
22043
|
if (opts.approval && opts.approval.length > 6) {
|
|
22044
|
-
throw new (0,
|
|
22044
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("approval must contain at most 6 labels");
|
|
22045
22045
|
}
|
|
22046
22046
|
}
|
|
22047
22047
|
function incompatibleGongmunWarnings(opts) {
|
|
@@ -22638,7 +22638,7 @@ function assertSequentialIds(rows, label, startId) {
|
|
|
22638
22638
|
const m = rows[i].match(/\bid="(\d+)"/);
|
|
22639
22639
|
const got = m ? Number(m[1]) : NaN;
|
|
22640
22640
|
if (got !== startId + i) {
|
|
22641
|
-
throw new (0,
|
|
22641
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(
|
|
22642
22642
|
`\uB0B4\uBD80 \uC624\uB958: ${label} id \uD30C\uD2F0\uC158 \uB4DC\uB9AC\uD504\uD2B8 \u2014 ${startId + i} \uC704\uCE58\uC5D0 id=${m ? m[1] : "?"} \uBC29\uCD9C. id \uC0C1\uC218(gen-ids)\uC640 \uC2E4\uC81C \uBC29\uCD9C \uC218\uAC00 \uC5B4\uAE0B\uB0AC\uB2E4 (GJ_CHAR_COUNT\uB958 \uCE74\uC6B4\uD2B8\xB7base \uC0B0\uC220 \uD655\uC778)`
|
|
22643
22643
|
);
|
|
22644
22644
|
}
|
|
@@ -22722,7 +22722,7 @@ function buildCharProperties(theme, gongmun, ratioVariants = [], extraCharPrXmls
|
|
|
22722
22722
|
}
|
|
22723
22723
|
const expectedBase = charVariantBase(richAssets, !!gongmun);
|
|
22724
22724
|
if (rows.length !== expectedBase) {
|
|
22725
|
-
throw new (0,
|
|
22725
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(
|
|
22726
22726
|
`\uB0B4\uBD80 \uC624\uB958: charPr \uAE30\uBCF8 \uBE14\uB85D \uBC29\uCD9C \uC218(${rows.length}) \u2260 charVariantBase(${expectedBase}) \u2014 gen-header \uBC29\uCD9C \uD589\uACFC gen-ids \uCE74\uC6B4\uD2B8 \uC0C1\uC218\uAC00 \uC5B4\uAE0B\uB0AC\uB2E4`
|
|
22727
22727
|
);
|
|
22728
22728
|
}
|
|
@@ -23618,7 +23618,7 @@ function escapeGfm(text) {
|
|
|
23618
23618
|
}
|
|
23619
23619
|
var HWP_SHAPE_ALT_TEXT_RE = /^(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|이등변 삼각형|직각 삼각형|선|직선|곡선|화살표|굵은 화살표|이중 화살표|오각형|육각형|팔각형|별|[4-8]점별|십자|십자형|구름|구름형|마름모|도넛|평행사변형|사다리꼴|부채꼴|호|반원|물결|번개|하트|빗금|블록 화살표|수식|표|그림|개체|그리기\s?개체|묶음\s?개체|글상자|수식\s?개체|OLE\s?개체)\s?입니다\.?$/gm;
|
|
23620
23620
|
function sanitizeText(text) {
|
|
23621
|
-
let result =
|
|
23621
|
+
let result = _chunkZMKTKJZNcjs.mapPuaText.call(void 0, text).replace(/[\u{F0000}-\u{FFFFD}]/gu, "").replace(HWP_SHAPE_ALT_TEXT_RE, "").replace(/ +/g, " ").trim();
|
|
23622
23622
|
if (result.length <= 30 && result.includes(" ")) {
|
|
23623
23623
|
const tokens = result.split(" ");
|
|
23624
23624
|
const koreanSingleCharCount = tokens.filter((t) => t.length === 1 && /[가-ㄱ-ㆎ]/.test(t)).length;
|
|
@@ -23790,7 +23790,7 @@ function parseHtmlTable(raw) {
|
|
|
23790
23790
|
const cs = parseInt(_optionalChain([attrs, 'access', _294 => _294.match, 'call', _295 => _295(/colspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _296 => _296[1]]) || "1", 10);
|
|
23791
23791
|
const rs = parseInt(_optionalChain([attrs, 'access', _297 => _297.match, 'call', _298 => _298(/rowspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _299 => _299[1]]) || "1", 10);
|
|
23792
23792
|
cellStart = m.index + m[0].length;
|
|
23793
|
-
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs,
|
|
23793
|
+
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs, _chunkZMKTKJZNcjs.MAX_COLS), rowSpan: clampSpan(isNaN(rs) ? 1 : rs, _chunkZMKTKJZNcjs.MAX_ROWS) };
|
|
23794
23794
|
} else if (cellStart >= 0 && cellInfo && currentRow) {
|
|
23795
23795
|
currentRow.push({ inner: raw.slice(cellStart, m.index), colSpan: cellInfo.colSpan, rowSpan: cellInfo.rowSpan });
|
|
23796
23796
|
cellStart = -1;
|
|
@@ -24446,8 +24446,8 @@ function layoutHtmlRows(rows) {
|
|
|
24446
24446
|
let c = 0;
|
|
24447
24447
|
for (const cell2 of rows[r].cells) {
|
|
24448
24448
|
while (occupied.has(`${r},${c}`)) c++;
|
|
24449
|
-
const colSpan = clampSpan(cell2.colSpan,
|
|
24450
|
-
const rowSpan = clampSpan(cell2.rowSpan,
|
|
24449
|
+
const colSpan = clampSpan(cell2.colSpan, _chunkZMKTKJZNcjs.MAX_COLS);
|
|
24450
|
+
const rowSpan = clampSpan(cell2.rowSpan, _chunkZMKTKJZNcjs.MAX_ROWS);
|
|
24451
24451
|
placed.push({ r, c, colSpan, rowSpan, inner: cell2.inner, isHeader: rows[r].tag === "th" });
|
|
24452
24452
|
for (let dr = 0; dr < rowSpan; dr++) {
|
|
24453
24453
|
for (let dc = 0; dc < colSpan; dc++) occupied.add(`${r + dr},${c + dc}`);
|
|
@@ -25748,7 +25748,7 @@ function builtinTemplateDir() {
|
|
|
25748
25748
|
for (const c of candidates) {
|
|
25749
25749
|
if (_fs.existsSync.call(void 0, _path.join.call(void 0, c, BUILTIN_TEMPLATES[0].file))) return c;
|
|
25750
25750
|
}
|
|
25751
|
-
throw new (0,
|
|
25751
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uB0B4\uC7A5 templates \uB514\uB809\uD1A0\uB9AC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (\uD328\uD0A4\uC9C0 \uC124\uCE58\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4)");
|
|
25752
25752
|
}
|
|
25753
25753
|
function readBuiltinTemplate(t) {
|
|
25754
25754
|
const buf = _fs.readFileSync.call(void 0, _path.join.call(void 0, builtinTemplateDir(), t.file));
|
|
@@ -26091,11 +26091,11 @@ function buildFloatPicXml(itemId, sizeHu, posXHu, posYHu, ids) {
|
|
|
26091
26091
|
return `<hp:pic xmlns:hc="http://www.hancom.co.kr/hwpml/2011/core" id="${ids.id}" zOrder="0" numberingType="PICTURE" textWrap="IN_FRONT_OF_TEXT" textFlow="BOTH_SIDES" lock="0" dropcapstyle="None" href="" groupLevel="0" instid="${ids.instid}" reverse="0"><hp:offset x="0" y="0"/><hp:orgSz width="${w}" height="${h}"/><hp:curSz width="${w}" height="${h}"/><hp:flip horizontal="0" vertical="0"/><hp:rotationInfo angle="0" centerX="${Math.round(w / 2)}" centerY="${Math.round(h / 2)}" rotateimage="1"/><hp:renderingInfo><hc:transMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/><hc:scaMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/><hc:rotMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/></hp:renderingInfo><hp:imgRect><hc:pt0 x="0" y="0"/><hc:pt1 x="${w}" y="0"/><hc:pt2 x="${w}" y="${h}"/><hc:pt3 x="0" y="${h}"/></hp:imgRect><hp:imgClip left="0" right="${w}" top="0" bottom="${h}"/><hp:inMargin left="0" right="0" top="0" bottom="0"/><hp:imgDim dimwidth="${w}" dimheight="${h}"/><hc:img binaryItemIDRef="${itemId}" bright="0" contrast="0" effect="REAL_PIC" alpha="0"/><hp:effects/><hp:sz width="${w}" widthRelTo="ABSOLUTE" height="${h}" heightRelTo="ABSOLUTE" protect="0"/><hp:pos treatAsChar="0" affectLSpacing="0" flowWithText="0" allowOverlap="1" holdAnchorAndSO="0" vertRelTo="PARA" horzRelTo="COLUMN" vertAlign="TOP" horzAlign="LEFT" vertOffset="${posYHu}" horzOffset="${posXHu}"/><hp:outMargin left="0" right="0" top="0" bottom="0"/><hp:shapeComment>kordoc seal</hp:shapeComment></hp:pic>`;
|
|
26092
26092
|
}
|
|
26093
26093
|
async function placeSealHwpx(hwpxBuffer, ops) {
|
|
26094
|
-
if (ops.length === 0) throw new (0,
|
|
26094
|
+
if (ops.length === 0) throw new (0, _chunkVQB5P5KJcjs.KordocError)("place_seal: \uBC30\uCE58\uD560 \uB3C4\uC7A5\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
26095
26095
|
const u8 = new Uint8Array(hwpxBuffer);
|
|
26096
26096
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
26097
26097
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort((a, b) => Number(_nullishCoalesce(_optionalChain([a, 'access', _401 => _401.match, 'call', _402 => _402(/(\d+)\.xml$/i), 'optionalAccess', _403 => _403[1]]), () => ( 0))) - Number(_nullishCoalesce(_optionalChain([b, 'access', _404 => _404.match, 'call', _405 => _405(/(\d+)\.xml$/i), 'optionalAccess', _406 => _406[1]]), () => ( 0))));
|
|
26098
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
26098
|
+
if (sectionPaths.length === 0) throw new (0, _chunkVQB5P5KJcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
26099
26099
|
const manifestPath = Object.keys(zip.files).find((name) => /\.hpf$/i.test(name));
|
|
26100
26100
|
const headerPath = Object.keys(zip.files).find((name) => /(^|\/)header\.xml$/i.test(name));
|
|
26101
26101
|
const styles = headerPath ? parseRenderStyles(await zip.file(headerPath).async("text")) : null;
|
|
@@ -26136,11 +26136,11 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
26136
26136
|
const manifestItems = [];
|
|
26137
26137
|
const placed = [];
|
|
26138
26138
|
for (const op of ops) {
|
|
26139
|
-
if (!op.anchor) throw new (0,
|
|
26140
|
-
if (!op.image || op.image.length === 0) throw new (0,
|
|
26139
|
+
if (!op.anchor) throw new (0, _chunkVQB5P5KJcjs.KordocError)("place_seal: anchor \uBB38\uAD6C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
26140
|
+
if (!op.image || op.image.length === 0) throw new (0, _chunkVQB5P5KJcjs.KordocError)("place_seal: \uB3C4\uC7A5 \uC774\uBBF8\uC9C0\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
26141
26141
|
const ext = (_nullishCoalesce(op.ext, () => ( "png"))).toLowerCase();
|
|
26142
|
-
if (!MIME[ext]) throw new (0,
|
|
26143
|
-
if (!imageMagicMatches(op.image, ext)) throw new (0,
|
|
26142
|
+
if (!MIME[ext]) throw new (0, _chunkVQB5P5KJcjs.KordocError)(`place_seal: \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC774\uBBF8\uC9C0 \uD655\uC7A5\uC790 .${ext} (png/jpg/bmp/gif)`);
|
|
26143
|
+
if (!imageMagicMatches(op.image, ext)) throw new (0, _chunkVQB5P5KJcjs.KordocError)(`place_seal: \uC774\uBBF8\uC9C0 \uB0B4\uC6A9\uC774 .${ext} \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 (\uB9E4\uC9C1\uBC14\uC774\uD2B8 \uBD88\uC77C\uCE58)`);
|
|
26144
26144
|
const wantOcc = _nullishCoalesce(op.occurrence, () => ( 0));
|
|
26145
26145
|
let found = null;
|
|
26146
26146
|
let total = 0;
|
|
@@ -26173,7 +26173,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
26173
26173
|
}
|
|
26174
26174
|
}
|
|
26175
26175
|
}
|
|
26176
|
-
throw new (0,
|
|
26176
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(
|
|
26177
26177
|
`place_seal: \uC575\uCEE4 "${op.anchor}" ${wantOcc}\uBC88\uC9F8 \uB4F1\uC7A5\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4 (\uBCF8\uBB38 \uB0B4 ${total}\uD68C \uB4F1\uC7A5 \u2014 occurrence 0..${Math.max(0, total - 1)})`
|
|
26178
26178
|
);
|
|
26179
26179
|
}
|
|
@@ -26181,7 +26181,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
26181
26181
|
const xml = sectionXmls[si];
|
|
26182
26182
|
const run = anchorRunInfo(xml, site.para, op.anchor);
|
|
26183
26183
|
if (!run) {
|
|
26184
|
-
throw new (0,
|
|
26184
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(`place_seal: \uC575\uCEE4 "${op.anchor}" \uBB38\uB2E8\uC5D0\uC11C run\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4`);
|
|
26185
26185
|
}
|
|
26186
26186
|
const charPrHeight = _nullishCoalesce(_optionalChain([styles, 'optionalAccess', _407 => _407.charPr, 'access', _408 => _408.get, 'call', _409 => _409(run.charPr), 'optionalAccess', _410 => _410.height]), () => ( 1e3));
|
|
26187
26187
|
const fontPt = charPrHeight / 100;
|
|
@@ -26459,7 +26459,7 @@ function pick(map, keys) {
|
|
|
26459
26459
|
return out;
|
|
26460
26460
|
}
|
|
26461
26461
|
async function hwpxToProfile(input) {
|
|
26462
|
-
const buf = input instanceof ArrayBuffer ? input :
|
|
26462
|
+
const buf = input instanceof ArrayBuffer ? input : _chunkVQB5P5KJcjs.toArrayBuffer.call(void 0, input);
|
|
26463
26463
|
const zip = await _jszip2.default.loadAsync(buf);
|
|
26464
26464
|
const parser = createXmlParser();
|
|
26465
26465
|
const headerFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( _optionalChain([zip, 'access', _432 => _432.file, 'call', _433 => _433(/[Hh]eader\.xml$/), 'optionalAccess', _434 => _434[0]])));
|
|
@@ -27387,7 +27387,7 @@ async function resolveSectionEntryNames(zip) {
|
|
|
27387
27387
|
const paths = sectionPathsFromManifest(xml).filter((p) => zip.file(p) !== null);
|
|
27388
27388
|
if (paths.length > 0) return paths;
|
|
27389
27389
|
}
|
|
27390
|
-
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(
|
|
27390
|
+
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(_chunkVQB5P5KJcjs.compareSectionPaths);
|
|
27391
27391
|
}
|
|
27392
27392
|
function sectionPathsFromManifest(xml) {
|
|
27393
27393
|
const attr = (tag, name) => {
|
|
@@ -27397,7 +27397,7 @@ function sectionPathsFromManifest(xml) {
|
|
|
27397
27397
|
const idToHref = /* @__PURE__ */ new Map();
|
|
27398
27398
|
for (const m of xml.matchAll(/<opf:item(\s(?:"[^"]*"|'[^']*'|[^>"'])*?)\/?>/g)) {
|
|
27399
27399
|
const id = attr(m[1], "id");
|
|
27400
|
-
const href =
|
|
27400
|
+
const href = _chunkVQB5P5KJcjs.normalizeSectionHref.call(void 0, attr(m[1], "href"));
|
|
27401
27401
|
if (id && href) idToHref.set(id, href);
|
|
27402
27402
|
}
|
|
27403
27403
|
const ordered = [];
|
|
@@ -27406,7 +27406,7 @@ function sectionPathsFromManifest(xml) {
|
|
|
27406
27406
|
if (href) ordered.push(href);
|
|
27407
27407
|
}
|
|
27408
27408
|
if (ordered.length > 0) return ordered;
|
|
27409
|
-
return Array.from(idToHref.values()).sort(
|
|
27409
|
+
return Array.from(idToHref.values()).sort(_chunkVQB5P5KJcjs.compareSectionPaths);
|
|
27410
27410
|
}
|
|
27411
27411
|
|
|
27412
27412
|
// src/roundtrip/patcher.ts
|
|
@@ -27517,9 +27517,9 @@ function buildOrigUnits(blocks) {
|
|
|
27517
27517
|
if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(sanitizeText(block.text))) {
|
|
27518
27518
|
const next = blocks[i + 1];
|
|
27519
27519
|
if (_optionalChain([next, 'optionalAccess', _467 => _467.type]) === "paragraph" && next.text && /관련\)?$/.test(next.text)) consume = 2;
|
|
27520
|
-
chunk =
|
|
27520
|
+
chunk = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
|
|
27521
27521
|
} else {
|
|
27522
|
-
chunk =
|
|
27522
|
+
chunk = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, [block]);
|
|
27523
27523
|
}
|
|
27524
27524
|
if (chunk) {
|
|
27525
27525
|
const subUnits = splitMarkdownUnits(chunk);
|
|
@@ -29139,12 +29139,12 @@ function blocksToChunks(blocks, options) {
|
|
|
29139
29139
|
let run = null;
|
|
29140
29140
|
const flushRun = () => {
|
|
29141
29141
|
if (!run) return;
|
|
29142
|
-
push("text", run.breadcrumb,
|
|
29142
|
+
push("text", run.breadcrumb, _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, run.blocks), [run.start, run.end], run.page);
|
|
29143
29143
|
run = null;
|
|
29144
29144
|
};
|
|
29145
29145
|
for (let i = 0; i < blocks.length; i++) {
|
|
29146
29146
|
const block = blocks[i];
|
|
29147
|
-
const md2 =
|
|
29147
|
+
const md2 = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, [block]);
|
|
29148
29148
|
if (!md2) continue;
|
|
29149
29149
|
if (block.type === "heading") {
|
|
29150
29150
|
flushRun();
|
|
@@ -29614,13 +29614,13 @@ async function htmlToPdf(html, options) {
|
|
|
29614
29614
|
try {
|
|
29615
29615
|
puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
|
|
29616
29616
|
} catch (e32) {
|
|
29617
|
-
throw new (0,
|
|
29617
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(
|
|
29618
29618
|
"PDF \uC0DD\uC131\uC5D0 puppeteer-core\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uC124\uCE58: npm install puppeteer-core"
|
|
29619
29619
|
);
|
|
29620
29620
|
}
|
|
29621
29621
|
const executablePath = _nullishCoalesce(process.env.PUPPETEER_EXECUTABLE_PATH, () => ( findChromiumPath()));
|
|
29622
29622
|
if (!executablePath) {
|
|
29623
|
-
throw new (0,
|
|
29623
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)(
|
|
29624
29624
|
"Chromium \uC2E4\uD589 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. PUPPETEER_EXECUTABLE_PATH \uD658\uACBD\uBCC0\uC218\uB97C \uC124\uC815\uD558\uC138\uC694."
|
|
29625
29625
|
);
|
|
29626
29626
|
}
|
|
@@ -29679,7 +29679,7 @@ async function markdownToPdf(markdown, options) {
|
|
|
29679
29679
|
return htmlToPdf(html, options);
|
|
29680
29680
|
}
|
|
29681
29681
|
async function blocksToPdf(blocks, options) {
|
|
29682
|
-
const markdown =
|
|
29682
|
+
const markdown = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, blocks);
|
|
29683
29683
|
return markdownToPdf(markdown, options);
|
|
29684
29684
|
}
|
|
29685
29685
|
|
|
@@ -30577,15 +30577,15 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode) {
|
|
|
30577
30577
|
async function renderHwpxToSvg(input, options) {
|
|
30578
30578
|
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _564 => _564.maxImageBytes]), () => ( 40 * 1024 * 1024));
|
|
30579
30579
|
const ab = input instanceof Uint8Array ? input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength) : input;
|
|
30580
|
-
|
|
30580
|
+
_chunkVQB5P5KJcjs.precheckZipSize.call(void 0, ab, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
30581
30581
|
let zip;
|
|
30582
30582
|
try {
|
|
30583
30583
|
zip = await _jszip2.default.loadAsync(input);
|
|
30584
30584
|
} catch (e33) {
|
|
30585
|
-
throw new (0,
|
|
30585
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("HWPX(ZIP) \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uB80C\uB354\uB294 HWPX\uB9CC \uC9C0\uC6D0");
|
|
30586
30586
|
}
|
|
30587
30587
|
const secFiles = zip.file(/Contents\/section\d+\.xml$/i).sort((a, b) => a.name.localeCompare(b.name));
|
|
30588
|
-
if (secFiles.length === 0) throw new (0,
|
|
30588
|
+
if (secFiles.length === 0) throw new (0, _chunkVQB5P5KJcjs.KordocError)("Contents/section0.xml \uC5C6\uC74C \u2014 HWPX\uAC00 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB428");
|
|
30589
30589
|
const warnings = [];
|
|
30590
30590
|
const headFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( zip.file("Contents/head.xml")));
|
|
30591
30591
|
const styles = headFile ? parseRenderStyles(await headFile.async("string")) : { charPr: /* @__PURE__ */ new Map(), paraAlign: /* @__PURE__ */ new Map(), paraGeom: /* @__PURE__ */ new Map(), borderFill: /* @__PURE__ */ new Map() };
|
|
@@ -30593,7 +30593,7 @@ async function renderHwpxToSvg(input, options) {
|
|
|
30593
30593
|
const secXmls = [];
|
|
30594
30594
|
for (const f of secFiles) {
|
|
30595
30595
|
const xml = await f.async("string");
|
|
30596
|
-
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
30596
|
+
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uC139\uC158 XML\uC774 \uD5C8\uC6A9 \uD06C\uAE30\uB97C \uCD08\uACFC");
|
|
30597
30597
|
secXmls.push(xml);
|
|
30598
30598
|
}
|
|
30599
30599
|
const binmap = /* @__PURE__ */ new Map();
|
|
@@ -30666,9 +30666,9 @@ async function renderHwpxToSvg(input, options) {
|
|
|
30666
30666
|
}
|
|
30667
30667
|
if (rendered.length === 0) {
|
|
30668
30668
|
if (noCacheSkipped) {
|
|
30669
|
-
throw new (0,
|
|
30669
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uC870\uD310 \uCE90\uC2DC(linesegarray) \uC5C6\uC74C \u2014 \uD55C\uCEF4\uC5D0\uC11C \uC800\uC7A5\uD55C HWPX\uB9CC \uB80C\uB354 \uAC00\uB2A5 (reflow \uC635\uC158\uC73C\uB85C \uD569\uC131 \uB80C\uB354 \uAC00\uB2A5)");
|
|
30670
30670
|
}
|
|
30671
|
-
throw new (0,
|
|
30671
|
+
throw new (0, _chunkVQB5P5KJcjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWPX\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
|
|
30672
30672
|
}
|
|
30673
30673
|
const GAP = 2400;
|
|
30674
30674
|
const clipDefs = [];
|
|
@@ -30704,13 +30704,13 @@ async function parse(input, options) {
|
|
|
30704
30704
|
if (typeof input === "string") {
|
|
30705
30705
|
try {
|
|
30706
30706
|
const buf = await _promises.readFile.call(void 0, input);
|
|
30707
|
-
buffer =
|
|
30707
|
+
buffer = _chunkVQB5P5KJcjs.toArrayBuffer.call(void 0, buf);
|
|
30708
30708
|
} catch (err) {
|
|
30709
30709
|
const msg2 = err instanceof Error && "code" in err && err.code === "ENOENT" ? `\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input}` : `\uD30C\uC77C \uC77D\uAE30 \uC2E4\uD328: ${input}`;
|
|
30710
30710
|
return { success: false, fileType: "unknown", error: msg2, code: "PARSE_ERROR" };
|
|
30711
30711
|
}
|
|
30712
30712
|
} else if (Buffer.isBuffer(input)) {
|
|
30713
|
-
buffer =
|
|
30713
|
+
buffer = _chunkVQB5P5KJcjs.toArrayBuffer.call(void 0, input);
|
|
30714
30714
|
} else {
|
|
30715
30715
|
buffer = input;
|
|
30716
30716
|
}
|
|
@@ -30744,18 +30744,18 @@ async function parse(input, options) {
|
|
|
30744
30744
|
}
|
|
30745
30745
|
async function parseImage(buffer, options) {
|
|
30746
30746
|
try {
|
|
30747
|
-
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-
|
|
30747
|
+
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-MGVXT6XD.cjs")));
|
|
30748
30748
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
30749
30749
|
return {
|
|
30750
30750
|
success: true,
|
|
30751
30751
|
fileType: "image",
|
|
30752
|
-
markdown:
|
|
30752
|
+
markdown: _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, blocks),
|
|
30753
30753
|
blocks,
|
|
30754
30754
|
warnings: warnings.length ? warnings : void 0,
|
|
30755
30755
|
pageCount: 1
|
|
30756
30756
|
};
|
|
30757
30757
|
} catch (err) {
|
|
30758
|
-
return { success: false, fileType: "image", error:
|
|
30758
|
+
return { success: false, fileType: "image", error: _chunkVQB5P5KJcjs.sanitizeError.call(void 0, err), code: _chunkVQB5P5KJcjs.classifyError.call(void 0, err) };
|
|
30759
30759
|
}
|
|
30760
30760
|
}
|
|
30761
30761
|
async function parseHwp3(buffer, options) {
|
|
@@ -30763,7 +30763,7 @@ async function parseHwp3(buffer, options) {
|
|
|
30763
30763
|
const { markdown, blocks, metadata, outline, warnings } = parseHwp3Document(buffer, options);
|
|
30764
30764
|
return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _571 => _571.pageCount]) };
|
|
30765
30765
|
} catch (err) {
|
|
30766
|
-
return { success: false, fileType: "hwp3", error:
|
|
30766
|
+
return { success: false, fileType: "hwp3", error: _chunkVQB5P5KJcjs.sanitizeError.call(void 0, err), code: _chunkVQB5P5KJcjs.classifyError.call(void 0, err) };
|
|
30767
30767
|
}
|
|
30768
30768
|
}
|
|
30769
30769
|
async function parseHwpx(buffer, options) {
|
|
@@ -30771,7 +30771,7 @@ async function parseHwpx(buffer, options) {
|
|
|
30771
30771
|
const { markdown, blocks, metadata, outline, warnings, images } = await parseHwpxDocument(buffer, options);
|
|
30772
30772
|
return { success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _572 => _572.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _573 => _573.pageCount]) };
|
|
30773
30773
|
} catch (err) {
|
|
30774
|
-
return { success: false, fileType: "hwpx", error:
|
|
30774
|
+
return { success: false, fileType: "hwpx", error: _chunkVQB5P5KJcjs.sanitizeError.call(void 0, err), code: _chunkVQB5P5KJcjs.classifyError.call(void 0, err) };
|
|
30775
30775
|
}
|
|
30776
30776
|
}
|
|
30777
30777
|
async function parseHwp(buffer, options) {
|
|
@@ -30797,13 +30797,13 @@ async function parseHwp(buffer, options) {
|
|
|
30797
30797
|
}
|
|
30798
30798
|
return { success: true, fileType: "hwp", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _575 => _575.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _576 => _576.pageCount]) };
|
|
30799
30799
|
} catch (err) {
|
|
30800
|
-
return { success: false, fileType: "hwp", error:
|
|
30800
|
+
return { success: false, fileType: "hwp", error: _chunkVQB5P5KJcjs.sanitizeError.call(void 0, err), code: _chunkVQB5P5KJcjs.classifyError.call(void 0, err) };
|
|
30801
30801
|
}
|
|
30802
30802
|
}
|
|
30803
30803
|
async function parsePdf(buffer, options) {
|
|
30804
30804
|
let parsePdfDocument;
|
|
30805
30805
|
try {
|
|
30806
|
-
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-
|
|
30806
|
+
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-JFGLN4DA.cjs")));
|
|
30807
30807
|
parsePdfDocument = mod.parsePdfDocument;
|
|
30808
30808
|
} catch (e35) {
|
|
30809
30809
|
return {
|
|
@@ -30818,7 +30818,7 @@ async function parsePdf(buffer, options) {
|
|
|
30818
30818
|
return { success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images, pageCount: _optionalChain([metadata, 'optionalAccess', _577 => _577.pageCount]) };
|
|
30819
30819
|
} catch (err) {
|
|
30820
30820
|
const isImageBased = err instanceof Error && "isImageBased" in err ? true : void 0;
|
|
30821
|
-
return { success: false, fileType: "pdf", error:
|
|
30821
|
+
return { success: false, fileType: "pdf", error: _chunkVQB5P5KJcjs.sanitizeError.call(void 0, err), code: _chunkVQB5P5KJcjs.classifyError.call(void 0, err), isImageBased };
|
|
30822
30822
|
}
|
|
30823
30823
|
}
|
|
30824
30824
|
async function parseXlsx(buffer, options) {
|
|
@@ -30826,7 +30826,7 @@ async function parseXlsx(buffer, options) {
|
|
|
30826
30826
|
const { markdown, blocks, metadata, warnings } = await parseXlsxDocument(buffer, options);
|
|
30827
30827
|
return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _578 => _578.pageCount]) };
|
|
30828
30828
|
} catch (err) {
|
|
30829
|
-
return { success: false, fileType: "xlsx", error:
|
|
30829
|
+
return { success: false, fileType: "xlsx", error: _chunkVQB5P5KJcjs.sanitizeError.call(void 0, err), code: _chunkVQB5P5KJcjs.classifyError.call(void 0, err) };
|
|
30830
30830
|
}
|
|
30831
30831
|
}
|
|
30832
30832
|
async function parseXls(buffer, options) {
|
|
@@ -30834,7 +30834,7 @@ async function parseXls(buffer, options) {
|
|
|
30834
30834
|
const { markdown, blocks, metadata, warnings } = await parseXlsDocument(buffer, options);
|
|
30835
30835
|
return { success: true, fileType: "xls", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _579 => _579.pageCount]) };
|
|
30836
30836
|
} catch (err) {
|
|
30837
|
-
return { success: false, fileType: "xls", error:
|
|
30837
|
+
return { success: false, fileType: "xls", error: _chunkVQB5P5KJcjs.sanitizeError.call(void 0, err), code: _chunkVQB5P5KJcjs.classifyError.call(void 0, err) };
|
|
30838
30838
|
}
|
|
30839
30839
|
}
|
|
30840
30840
|
async function parseDocx(buffer, options) {
|
|
@@ -30842,7 +30842,7 @@ async function parseDocx(buffer, options) {
|
|
|
30842
30842
|
const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
|
|
30843
30843
|
return { success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _580 => _580.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _581 => _581.pageCount]) };
|
|
30844
30844
|
} catch (err) {
|
|
30845
|
-
return { success: false, fileType: "docx", error:
|
|
30845
|
+
return { success: false, fileType: "docx", error: _chunkVQB5P5KJcjs.sanitizeError.call(void 0, err), code: _chunkVQB5P5KJcjs.classifyError.call(void 0, err) };
|
|
30846
30846
|
}
|
|
30847
30847
|
}
|
|
30848
30848
|
async function parseHwpml(buffer, options) {
|
|
@@ -30850,16 +30850,16 @@ async function parseHwpml(buffer, options) {
|
|
|
30850
30850
|
const { markdown, blocks, metadata, outline, warnings } = parseHwpmlDocument(buffer, options);
|
|
30851
30851
|
return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _582 => _582.pageCount]) };
|
|
30852
30852
|
} catch (err) {
|
|
30853
|
-
return { success: false, fileType: "hwpml", error:
|
|
30853
|
+
return { success: false, fileType: "hwpml", error: _chunkVQB5P5KJcjs.sanitizeError.call(void 0, err), code: _chunkVQB5P5KJcjs.classifyError.call(void 0, err) };
|
|
30854
30854
|
}
|
|
30855
30855
|
}
|
|
30856
30856
|
async function fillForm(input, values, outputFormat = "markdown") {
|
|
30857
30857
|
let buffer;
|
|
30858
30858
|
if (typeof input === "string") {
|
|
30859
30859
|
const buf = await _promises.readFile.call(void 0, input);
|
|
30860
|
-
buffer =
|
|
30860
|
+
buffer = _chunkVQB5P5KJcjs.toArrayBuffer.call(void 0, buf);
|
|
30861
30861
|
} else if (Buffer.isBuffer(input)) {
|
|
30862
|
-
buffer =
|
|
30862
|
+
buffer = _chunkVQB5P5KJcjs.toArrayBuffer.call(void 0, input);
|
|
30863
30863
|
} else {
|
|
30864
30864
|
buffer = input;
|
|
30865
30865
|
}
|
|
@@ -30885,7 +30885,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
30885
30885
|
throw new Error(`\uC11C\uC2DD \uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
|
|
30886
30886
|
}
|
|
30887
30887
|
const fill = fillFormFields(parsed.blocks, values);
|
|
30888
|
-
const markdown =
|
|
30888
|
+
const markdown = _chunkZMKTKJZNcjs.blocksToMarkdown.call(void 0, fill.blocks);
|
|
30889
30889
|
if (outputFormat === "hwpx") {
|
|
30890
30890
|
const hwpxBuffer = await markdownToHwpx(markdown);
|
|
30891
30891
|
return { output: hwpxBuffer, format: "hwpx", fill };
|
|
@@ -30964,5 +30964,5 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
30964
30964
|
|
|
30965
30965
|
|
|
30966
30966
|
|
|
30967
|
-
exports.BUILTIN_TEMPLATES = BUILTIN_TEMPLATES; exports.DEFAULT_REDACT_RULES = DEFAULT_REDACT_RULES; exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.SPACE_EM_FIXED = SPACE_EM_FIXED; exports.SPACE_EM_FONT = SPACE_EM_FONT; exports.VERSION =
|
|
30967
|
+
exports.BUILTIN_TEMPLATES = BUILTIN_TEMPLATES; exports.DEFAULT_REDACT_RULES = DEFAULT_REDACT_RULES; exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.SPACE_EM_FIXED = SPACE_EM_FIXED; exports.SPACE_EM_FONT = SPACE_EM_FONT; exports.VERSION = _chunkVQB5P5KJcjs.VERSION; exports.ValueCursor = ValueCursor; exports.applySplices = applySplices; exports.blocksToChunks = blocksToChunks; exports.blocksToMarkdown = _chunkZMKTKJZNcjs.blocksToMarkdown; exports.blocksToPdf = blocksToPdf; exports.buildParagraphSplices = buildParagraphSplices; exports.buildRangeSplices = buildRangeSplices; exports.charWidthEm1000 = charWidthEm1000; exports.compare = compare; exports.detectFormat = detectFormat; exports.detectOle2Format = detectOle2Format; exports.detectZipFormat = detectZipFormat; exports.diffBlocks = diffBlocks; exports.extractClickHereFields = extractClickHereFields; exports.extractFormFields = extractFormFields; exports.extractFormSchema = extractFormSchema; exports.fillForm = fillForm; exports.fillFormFields = fillFormFields; exports.fillHwpx = fillHwpx; exports.fillWithUniqueGuard = fillWithUniqueGuard; exports.fitRatioForFewerLines = fitRatioForFewerLines; exports.formatFillValue = formatFillValue; exports.gongmunLintWarnings = gongmunLintWarnings; exports.hwpxToProfile = hwpxToProfile; exports.incompatibleGongmunWarnings = incompatibleGongmunWarnings; exports.inferFieldType = inferFieldType; exports.isHwpxFile = isHwpxFile; exports.isKnownFont = isKnownFont; exports.isLabelCell = isLabelCell; exports.isOldHwpFile = isOldHwpFile; exports.isPdfFile = isPdfFile; exports.isZipFile = isZipFile; exports.lintGongmunText = lintGongmunText; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; exports.measureTextWidth = measureTextWidth; exports.normalizeGongmunPreset = normalizeGongmunPreset; exports.openHwpxDocument = openHwpxDocument; exports.parse = parse; exports.parseDocx = parseDocx; exports.parseHwp = parseHwp; exports.parseHwp3 = parseHwp3; exports.parseHwpml = parseHwpml; exports.parseHwpx = parseHwpx; exports.parseImage = parseImage; exports.parsePdf = parsePdf; exports.parseXls = parseXls; exports.parseXlsx = parseXlsx; exports.patchHwp = patchHwp; exports.patchHwpx = patchHwpx; exports.patchHwpxBlocks = patchHwpxBlocks; exports.placeSealHwpx = placeSealHwpx; exports.readBuiltinTemplate = readBuiltinTemplate; exports.readBuiltinTemplateSample = readBuiltinTemplateSample; exports.redactMarkdown = redactMarkdown; exports.redactText = redactText; exports.renderHtml = renderHtml; exports.renderHwpxToSvg = renderHwpxToSvg; exports.resolveBuiltinTemplate = resolveBuiltinTemplate; exports.scanSectionXml = scanSectionXml; exports.simulateWrap = simulateWrap; exports.simulateWrapKeepWord = simulateWrapKeepWord; exports.unknownFontWarnings = unknownFontWarnings; exports.validateHwpx = validateHwpx;
|
|
30968
30968
|
//# sourceMappingURL=index.cjs.map
|