kordoc 3.5.0 → 3.5.2
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/LICENSE +21 -21
- package/README.md +590 -590
- package/dist/{-GKNSTVEZ.js → -LYUGJZQG.js} +5 -5
- package/dist/{chunk-X34YWRL5.cjs → chunk-DCZVOIEO.cjs} +1 -1
- package/dist/chunk-DCZVOIEO.cjs.map +1 -0
- package/dist/{chunk-GTCJQANY.js → chunk-DN5LTND6.js} +48 -38
- package/dist/chunk-DN5LTND6.js.map +1 -0
- package/dist/{chunk-4JLD2IT7.cjs → chunk-G44XLS26.cjs} +25 -11
- package/dist/chunk-G44XLS26.cjs.map +1 -0
- package/dist/{chunk-AIQ3ISQU.js → chunk-GE43BE46.js} +1 -1
- package/dist/chunk-GE43BE46.js.map +1 -0
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/{chunk-CFQLK3LM.js → chunk-MEPHGCPQ.js} +1 -1
- package/dist/chunk-MEPHGCPQ.js.map +1 -0
- package/dist/{chunk-3TBUDJDE.js → chunk-MOL7MDBG.js} +1 -1
- package/dist/chunk-MOL7MDBG.js.map +1 -0
- package/dist/{chunk-A4LSWJEC.js → chunk-NOIHZQWC.js} +16 -2
- package/dist/chunk-NOIHZQWC.js.map +1 -0
- package/dist/{chunk-AHDNELBR.js → chunk-QXXQIZBH.js} +16 -2
- package/dist/chunk-QXXQIZBH.js.map +1 -0
- package/dist/cli.js +8 -8
- package/dist/cli.js.map +1 -1
- package/dist/{detect-NTR2FUEG.js → detect-RI2MQ33K.js} +2 -2
- package/dist/{formula-ZYUDQHD3.cjs → formula-5NKVS2LR.cjs} +1 -1
- package/dist/formula-5NKVS2LR.cjs.map +1 -0
- package/dist/{formula-KOQV353G.js → formula-JCNF43NE.js} +1 -1
- package/dist/formula-JCNF43NE.js.map +1 -0
- package/dist/{formula-MEDGYQXS.js → formula-RXVSQPXI.js} +1 -1
- package/dist/formula-RXVSQPXI.js.map +1 -0
- package/dist/index.cjs +185 -175
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -36
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +6 -6
- package/dist/mcp.js.map +1 -1
- package/dist/page-range-737B4EZW.js +8 -0
- package/dist/page-range-LNMXJU6W.js +7 -0
- package/dist/page-range-P7SDW6LR.cjs +8 -0
- package/dist/page-range-P7SDW6LR.cjs.map +1 -0
- package/dist/{parser-25ISHR7Q.cjs → parser-2O276TRF.cjs} +18 -18
- package/dist/parser-2O276TRF.cjs.map +1 -0
- package/dist/{parser-LBLPN3KY.js → parser-4FFTFIYL.js} +5 -5
- package/dist/parser-4FFTFIYL.js.map +1 -0
- package/dist/{parser-LMBDB7RM.js → parser-KDF76UCB.js} +5 -5
- package/dist/parser-KDF76UCB.js.map +1 -0
- package/dist/{provider-H4WWSPOV.js → provider-4ZJKV3DC.js} +1 -1
- package/dist/provider-4ZJKV3DC.js.map +1 -0
- package/dist/{provider-7H4CPZYS.js → provider-AKROB7WQ.js} +1 -1
- package/dist/provider-AKROB7WQ.js.map +1 -0
- package/dist/{provider-5K7O3Z2O.cjs → provider-G4C2V2PD.cjs} +1 -1
- package/dist/provider-G4C2V2PD.cjs.map +1 -0
- package/dist/{setup-QSJ2INNS.js → setup-57FB3LSP.js} +1 -1
- package/dist/setup-57FB3LSP.js.map +1 -0
- package/dist/{watch-77CYT54V.js → watch-MF7JFR7S.js} +5 -5
- package/dist/watch-MF7JFR7S.js.map +1 -0
- package/package.json +98 -98
- package/dist/chunk-3TBUDJDE.js.map +0 -1
- package/dist/chunk-4JLD2IT7.cjs.map +0 -1
- package/dist/chunk-A4LSWJEC.js.map +0 -1
- package/dist/chunk-AHDNELBR.js.map +0 -1
- package/dist/chunk-AIQ3ISQU.js.map +0 -1
- package/dist/chunk-CFQLK3LM.js.map +0 -1
- package/dist/chunk-GTCJQANY.js.map +0 -1
- package/dist/chunk-X34YWRL5.cjs.map +0 -1
- package/dist/formula-KOQV353G.js.map +0 -1
- package/dist/formula-MEDGYQXS.js.map +0 -1
- package/dist/formula-ZYUDQHD3.cjs.map +0 -1
- package/dist/page-range-CIRRJPXJ.js +0 -7
- package/dist/page-range-OF5I4PQY.js +0 -8
- package/dist/page-range-TPIRSA3J.cjs +0 -8
- package/dist/page-range-TPIRSA3J.cjs.map +0 -1
- package/dist/parser-25ISHR7Q.cjs.map +0 -1
- package/dist/parser-LBLPN3KY.js.map +0 -1
- package/dist/parser-LMBDB7RM.js.map +0 -1
- package/dist/provider-5K7O3Z2O.cjs.map +0 -1
- package/dist/provider-7H4CPZYS.js.map +0 -1
- package/dist/provider-H4WWSPOV.js.map +0 -1
- package/dist/setup-QSJ2INNS.js.map +0 -1
- package/dist/watch-77CYT54V.js.map +0 -1
- /package/dist/{-GKNSTVEZ.js.map → -LYUGJZQG.js.map} +0 -0
- /package/dist/{detect-NTR2FUEG.js.map → detect-RI2MQ33K.js.map} +0 -0
- /package/dist/{page-range-CIRRJPXJ.js.map → page-range-737B4EZW.js.map} +0 -0
- /package/dist/{page-range-OF5I4PQY.js.map → page-range-LNMXJU6W.js.map} +0 -0
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
patchHwpxBlocks,
|
|
34
34
|
renderHtml,
|
|
35
35
|
scanSectionXml
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-DN5LTND6.js";
|
|
37
37
|
import {
|
|
38
38
|
detectFormat,
|
|
39
39
|
detectOle2Format,
|
|
@@ -42,12 +42,12 @@ import {
|
|
|
42
42
|
isOldHwpFile,
|
|
43
43
|
isPdfFile,
|
|
44
44
|
isZipFile
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-MEPHGCPQ.js";
|
|
46
46
|
import {
|
|
47
47
|
VERSION,
|
|
48
48
|
blocksToMarkdown
|
|
49
|
-
} from "./chunk-
|
|
50
|
-
import "./chunk-
|
|
49
|
+
} from "./chunk-NOIHZQWC.js";
|
|
50
|
+
import "./chunk-MOL7MDBG.js";
|
|
51
51
|
export {
|
|
52
52
|
HwpxSession,
|
|
53
53
|
PRESET_ALIAS,
|
|
@@ -92,4 +92,4 @@ export {
|
|
|
92
92
|
renderHtml,
|
|
93
93
|
scanSectionXml
|
|
94
94
|
};
|
|
95
|
-
//# sourceMappingURL=-
|
|
95
|
+
//# sourceMappingURL=-LYUGJZQG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/chris_gomdori/workspace/kordoc/dist/chunk-DCZVOIEO.cjs","../src/page-range.ts"],"names":[],"mappings":"AAAA;ACSO,SAAS,cAAA,CAAe,IAAA,EAAyB,QAAA,EAA+B;AACrF,EAAA,MAAM,OAAA,kBAAS,IAAI,GAAA,CAAY,CAAA;AAC/B,EAAA,GAAA,CAAI,SAAA,GAAY,CAAA,EAAG,OAAO,MAAA;AAE1B,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,EAAG;AACvB,IAAA,IAAA,CAAA,MAAW,EAAA,GAAK,IAAA,EAAM;AACpB,MAAA,MAAM,KAAA,EAAO,IAAA,CAAK,KAAA,CAAM,CAAC,CAAA;AACzB,MAAA,GAAA,CAAI,KAAA,GAAQ,EAAA,GAAK,KAAA,GAAQ,QAAA,EAAU,MAAA,CAAO,GAAA,CAAI,IAAI,CAAA;AAAA,IACpD;AACA,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,GAAA,CAAI,OAAO,KAAA,IAAS,SAAA,GAAY,IAAA,CAAK,IAAA,CAAK,EAAA,IAAM,EAAA,EAAI,OAAO,MAAA;AAE3D,EAAA,MAAM,MAAA,EAAQ,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAC5B,EAAA,IAAA,CAAA,MAAW,KAAA,GAAQ,KAAA,EAAO;AACxB,IAAA,MAAM,QAAA,EAAU,IAAA,CAAK,IAAA,CAAK,CAAA;AAC1B,IAAA,GAAA,CAAI,CAAC,OAAA,EAAS,QAAA;AAEd,IAAA,MAAM,WAAA,EAAa,OAAA,CAAQ,KAAA,CAAM,qBAAqB,CAAA;AACtD,IAAA,GAAA,CAAI,UAAA,EAAY;AACd,MAAA,MAAM,MAAA,EAAQ,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,QAAA,CAAS,UAAA,CAAW,CAAC,CAAA,EAAG,EAAE,CAAC,CAAA;AACrD,MAAA,MAAM,IAAA,EAAM,IAAA,CAAK,GAAA,CAAI,QAAA,EAAU,QAAA,CAAS,UAAA,CAAW,CAAC,CAAA,EAAG,EAAE,CAAC,CAAA;AAC1D,MAAA,IAAA,CAAA,IAAS,EAAA,EAAI,KAAA,EAAO,EAAA,GAAK,GAAA,EAAK,CAAA,EAAA,EAAK,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA;AAAA,IACjD,EAAA,KAAO;AACL,MAAA,MAAM,KAAA,EAAO,QAAA,CAAS,OAAA,EAAS,EAAE,CAAA;AACjC,MAAA,GAAA,CAAI,CAAC,KAAA,CAAM,IAAI,EAAA,GAAK,KAAA,GAAQ,EAAA,GAAK,KAAA,GAAQ,QAAA,EAAU,MAAA,CAAO,GAAA,CAAI,IAAI,CAAA;AAAA,IACpE;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT;ADZA;AACA;AACE;AACF,wCAAC","file":"/Users/chris_gomdori/workspace/kordoc/dist/chunk-DCZVOIEO.cjs","sourcesContent":[null,"/** 페이지/섹션 범위 파싱 유틸리티 */\n\n/**\n * 페이지 범위 지정을 1-based Set<number>로 변환.\n *\n * @param spec - [1,2,3] 또는 \"1-3\" 또는 \"1,3,5-7\"\n * @param maxPages - 최대 페이지 수 (클램핑 상한)\n * @returns 1-based 페이지 번호 Set\n */\nexport function parsePageRange(spec: number[] | string, maxPages: number): Set<number> {\n const result = new Set<number>()\n if (maxPages <= 0) return result\n\n if (Array.isArray(spec)) {\n for (const n of spec) {\n const page = Math.round(n)\n if (page >= 1 && page <= maxPages) result.add(page)\n }\n return result\n }\n\n if (typeof spec !== \"string\" || spec.trim() === \"\") return result\n\n const parts = spec.split(\",\")\n for (const part of parts) {\n const trimmed = part.trim()\n if (!trimmed) continue\n\n const rangeMatch = trimmed.match(/^(\\d+)\\s*-\\s*(\\d+)$/)\n if (rangeMatch) {\n const start = Math.max(1, parseInt(rangeMatch[1], 10))\n const end = Math.min(maxPages, parseInt(rangeMatch[2], 10))\n for (let i = start; i <= end; i++) result.add(i)\n } else {\n const page = parseInt(trimmed, 10)\n if (!isNaN(page) && page >= 1 && page <= maxPages) result.add(page)\n }\n }\n\n return result\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
detectOle2Format,
|
|
5
5
|
detectZipFormat,
|
|
6
6
|
parseLenientCfb
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MEPHGCPQ.js";
|
|
8
8
|
import {
|
|
9
9
|
HEADING_RATIO_H1,
|
|
10
10
|
HEADING_RATIO_H2,
|
|
@@ -15,18 +15,20 @@ import {
|
|
|
15
15
|
blocksToMarkdown,
|
|
16
16
|
buildTable,
|
|
17
17
|
classifyError,
|
|
18
|
+
compareSectionPaths,
|
|
18
19
|
convertTableToText,
|
|
19
20
|
flattenLayoutTables,
|
|
20
21
|
isPathTraversal,
|
|
21
22
|
mapPuaText,
|
|
23
|
+
normalizeSectionHref,
|
|
22
24
|
precheckZipSize,
|
|
23
25
|
sanitizeHref,
|
|
24
26
|
stripDtd,
|
|
25
27
|
toArrayBuffer
|
|
26
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-NOIHZQWC.js";
|
|
27
29
|
import {
|
|
28
30
|
parsePageRange
|
|
29
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MOL7MDBG.js";
|
|
30
32
|
|
|
31
33
|
// src/index.ts
|
|
32
34
|
import { readFile } from "fs/promises";
|
|
@@ -412,14 +414,27 @@ function findBrackets(eqString, startIdx, direction) {
|
|
|
412
414
|
const [s, e] = findBrackets(flipped, newStartIdx, 1);
|
|
413
415
|
return [flipped.length - e, flipped.length - s];
|
|
414
416
|
}
|
|
415
|
-
function
|
|
416
|
-
let
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
if (
|
|
420
|
-
|
|
417
|
+
function findEnclosingBrackets(eqString, startIdx) {
|
|
418
|
+
let depth = 0;
|
|
419
|
+
for (let idx = startIdx - 1; idx >= 0; idx--) {
|
|
420
|
+
const ch = eqString[idx];
|
|
421
|
+
if (ch === "}") {
|
|
422
|
+
depth += 1;
|
|
423
|
+
} else if (ch === "{") {
|
|
424
|
+
if (depth > 0) {
|
|
425
|
+
depth -= 1;
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
try {
|
|
429
|
+
const [start, end] = findBrackets(eqString, idx, 1);
|
|
430
|
+
if (start === idx && end > startIdx) return [start, end];
|
|
431
|
+
} catch {
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
421
436
|
}
|
|
422
|
-
return
|
|
437
|
+
return null;
|
|
423
438
|
}
|
|
424
439
|
function replaceFrac(eqString) {
|
|
425
440
|
const hmlFrac = "over";
|
|
@@ -472,8 +487,9 @@ function replaceAllMatrix(eqString) {
|
|
|
472
487
|
const elem = replaceElements(input.slice(eStart, eEnd));
|
|
473
488
|
let beforeMat;
|
|
474
489
|
let afterMat;
|
|
475
|
-
|
|
476
|
-
|
|
490
|
+
const outer = matElem.removeOutterBrackets ? findEnclosingBrackets(input, cursor) : null;
|
|
491
|
+
if (outer && outer[1] >= eEnd) {
|
|
492
|
+
const [bStart, bEnd] = outer;
|
|
477
493
|
beforeMat = input.slice(0, bStart);
|
|
478
494
|
afterMat = input.slice(bEnd);
|
|
479
495
|
} else {
|
|
@@ -499,10 +515,11 @@ function replaceAllBar(eqString) {
|
|
|
499
515
|
if (cursor === -1) break;
|
|
500
516
|
try {
|
|
501
517
|
const [eStart, eEnd] = findBrackets(input, cursor, 1);
|
|
502
|
-
const [bStart, bEnd] = findOutterBrackets(input, cursor);
|
|
503
518
|
const elem = input.slice(eStart, eEnd);
|
|
504
|
-
const
|
|
505
|
-
const
|
|
519
|
+
const outer = findEnclosingBrackets(input, cursor);
|
|
520
|
+
const [replaceStart, replaceEnd] = outer && outer[1] >= eEnd ? outer : [cursor, eEnd];
|
|
521
|
+
const beforeBar = input.slice(0, replaceStart);
|
|
522
|
+
const afterBar = input.slice(replaceEnd);
|
|
506
523
|
input = beforeBar + barElem + elem + afterBar;
|
|
507
524
|
} catch {
|
|
508
525
|
return input;
|
|
@@ -1137,24 +1154,19 @@ async function resolveSectionPaths(zip) {
|
|
|
1137
1154
|
if (paths.length > 0) return paths;
|
|
1138
1155
|
}
|
|
1139
1156
|
const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/);
|
|
1140
|
-
return sectionFiles.map((f) => f.name).sort();
|
|
1157
|
+
return sectionFiles.map((f) => f.name).sort(compareSectionPaths);
|
|
1141
1158
|
}
|
|
1142
1159
|
function parseSectionPathsFromManifest(xml) {
|
|
1143
1160
|
const parser = createXmlParser();
|
|
1144
1161
|
const doc = parser.parseFromString(stripDtd(xml), "text/xml");
|
|
1145
1162
|
const items = doc.getElementsByTagName("opf:item");
|
|
1146
1163
|
const spine = doc.getElementsByTagName("opf:itemref");
|
|
1147
|
-
const isSectionId = (id) => /^s/i.test(id) || id.toLowerCase().includes("section");
|
|
1148
1164
|
const idToHref = /* @__PURE__ */ new Map();
|
|
1149
1165
|
for (let i = 0; i < items.length; i++) {
|
|
1150
1166
|
const item = items[i];
|
|
1151
1167
|
const id = item.getAttribute("id") || "";
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
if (!isSectionId(id) && !mediaType.includes("xml")) continue;
|
|
1155
|
-
if (!href.startsWith("/") && !href.startsWith("Contents/") && isSectionId(id))
|
|
1156
|
-
href = "Contents/" + href;
|
|
1157
|
-
idToHref.set(id, href);
|
|
1168
|
+
const href = normalizeSectionHref(item.getAttribute("href") || "");
|
|
1169
|
+
if (id && href) idToHref.set(id, href);
|
|
1158
1170
|
}
|
|
1159
1171
|
if (spine.length > 0) {
|
|
1160
1172
|
const ordered = [];
|
|
@@ -1164,7 +1176,7 @@ function parseSectionPathsFromManifest(xml) {
|
|
|
1164
1176
|
}
|
|
1165
1177
|
if (ordered.length > 0) return ordered;
|
|
1166
1178
|
}
|
|
1167
|
-
return Array.from(idToHref.
|
|
1179
|
+
return Array.from(idToHref.values()).sort(compareSectionPaths);
|
|
1168
1180
|
}
|
|
1169
1181
|
function detectHwpxHeadings(blocks, styleMap) {
|
|
1170
1182
|
if (blocks.some((b) => b.type === "heading")) return;
|
|
@@ -16689,7 +16701,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
16689
16701
|
}
|
|
16690
16702
|
let pageFilter = null;
|
|
16691
16703
|
if (options?.pages) {
|
|
16692
|
-
const { parsePageRange: parsePageRange2 } = await import("./page-range-
|
|
16704
|
+
const { parsePageRange: parsePageRange2 } = await import("./page-range-737B4EZW.js");
|
|
16693
16705
|
pageFilter = parsePageRange2(options.pages, sheets.length);
|
|
16694
16706
|
}
|
|
16695
16707
|
const blocks = [];
|
|
@@ -17327,7 +17339,7 @@ async function parseXlsDocument(buffer, options) {
|
|
|
17327
17339
|
const totalSheets = Math.min(globals.sheets.length, MAX_SHEETS2);
|
|
17328
17340
|
let pageFilter = null;
|
|
17329
17341
|
if (options?.pages) {
|
|
17330
|
-
const { parsePageRange: parsePageRange2 } = await import("./page-range-
|
|
17342
|
+
const { parsePageRange: parsePageRange2 } = await import("./page-range-737B4EZW.js");
|
|
17331
17343
|
pageFilter = parsePageRange2(options.pages, totalSheets);
|
|
17332
17344
|
}
|
|
17333
17345
|
const allBlocks = [];
|
|
@@ -20223,7 +20235,8 @@ ${base2.join("\n")}
|
|
|
20223
20235
|
];
|
|
20224
20236
|
for (let d = 0; d < GONGMUN_LIST_LEVELS; d++) {
|
|
20225
20237
|
const { left, indent } = levelIndent(d, gongmun.bodyHeight, gongmun.numbering);
|
|
20226
|
-
|
|
20238
|
+
const sectionGap = gongmun.numbering === "report" && d === 0 ? Math.round(gongmun.bodyHeight * 0.5) : 0;
|
|
20239
|
+
base.push(paraPr(GONGMUN_LIST_BASE + d, { align: "JUSTIFY", lineSpacing: ls, left, indent, spaceBefore: sectionGap }));
|
|
20227
20240
|
}
|
|
20228
20241
|
base.push(paraPr(GONGMUN_CENTER, { align: "CENTER", lineSpacing: ls }));
|
|
20229
20242
|
return `<hh:paraProperties itemCnt="${base.length}">
|
|
@@ -20434,7 +20447,8 @@ function blocksToSectionXml(blocks, theme, gongmun) {
|
|
|
20434
20447
|
const marker2 = info?.marker ?? "";
|
|
20435
20448
|
const content = block.text || "";
|
|
20436
20449
|
const text = marker2 ? `${marker2} ${content}` : content;
|
|
20437
|
-
|
|
20450
|
+
const listCharPr = gongmun.numbering === "report" && depth === 0 ? CHAR_BOLD : CHAR_NORMAL;
|
|
20451
|
+
xml = generateParagraph(text, GONGMUN_LIST_BASE + depth, listCharPr);
|
|
20438
20452
|
break;
|
|
20439
20453
|
}
|
|
20440
20454
|
const indent = block.indent || 0;
|
|
@@ -21255,10 +21269,9 @@ async function resolveSectionEntryNames(zip) {
|
|
|
21255
21269
|
const paths = sectionPathsFromManifest(xml).filter((p) => zip.file(p) !== null);
|
|
21256
21270
|
if (paths.length > 0) return paths;
|
|
21257
21271
|
}
|
|
21258
|
-
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort();
|
|
21272
|
+
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(compareSectionPaths);
|
|
21259
21273
|
}
|
|
21260
21274
|
function sectionPathsFromManifest(xml) {
|
|
21261
|
-
const isSectionId = (id) => /^s/i.test(id) || id.toLowerCase().includes("section");
|
|
21262
21275
|
const attr = (tag, name) => {
|
|
21263
21276
|
const m = tag.match(new RegExp(`(?:^|\\s)${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)')`));
|
|
21264
21277
|
return m ? m[1] ?? m[2] : "";
|
|
@@ -21266,11 +21279,8 @@ function sectionPathsFromManifest(xml) {
|
|
|
21266
21279
|
const idToHref = /* @__PURE__ */ new Map();
|
|
21267
21280
|
for (const m of xml.matchAll(/<opf:item(\s(?:"[^"]*"|'[^']*'|[^>"'])*?)\/?>/g)) {
|
|
21268
21281
|
const id = attr(m[1], "id");
|
|
21269
|
-
|
|
21270
|
-
|
|
21271
|
-
if (!isSectionId(id) && !mediaType.includes("xml")) continue;
|
|
21272
|
-
if (!href.startsWith("/") && !href.startsWith("Contents/") && isSectionId(id)) href = "Contents/" + href;
|
|
21273
|
-
if (id) idToHref.set(id, href);
|
|
21282
|
+
const href = normalizeSectionHref(attr(m[1], "href"));
|
|
21283
|
+
if (id && href) idToHref.set(id, href);
|
|
21274
21284
|
}
|
|
21275
21285
|
const ordered = [];
|
|
21276
21286
|
for (const m of xml.matchAll(/<opf:itemref(\s(?:"[^"]*"|'[^']*'|[^>"'])*?)\/?>/g)) {
|
|
@@ -21278,7 +21288,7 @@ function sectionPathsFromManifest(xml) {
|
|
|
21278
21288
|
if (href) ordered.push(href);
|
|
21279
21289
|
}
|
|
21280
21290
|
if (ordered.length > 0) return ordered;
|
|
21281
|
-
return Array.from(idToHref.
|
|
21291
|
+
return Array.from(idToHref.values()).sort(compareSectionPaths);
|
|
21282
21292
|
}
|
|
21283
21293
|
|
|
21284
21294
|
// src/roundtrip/patcher.ts
|
|
@@ -23287,7 +23297,7 @@ async function parseHwp(buffer, options) {
|
|
|
23287
23297
|
async function parsePdf(buffer, options) {
|
|
23288
23298
|
let parsePdfDocument;
|
|
23289
23299
|
try {
|
|
23290
|
-
const mod = await import("./parser-
|
|
23300
|
+
const mod = await import("./parser-KDF76UCB.js");
|
|
23291
23301
|
parsePdfDocument = mod.parsePdfDocument;
|
|
23292
23302
|
} catch {
|
|
23293
23303
|
return {
|
|
@@ -23414,4 +23424,4 @@ export {
|
|
|
23414
23424
|
parseHwpml,
|
|
23415
23425
|
fillForm
|
|
23416
23426
|
};
|
|
23417
|
-
//# sourceMappingURL=chunk-
|
|
23427
|
+
//# sourceMappingURL=chunk-DN5LTND6.js.map
|