kordoc 4.2.4 → 4.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/{-2M56QRNH.js → -UYYP67I6.js} +8 -8
- package/dist/{chunk-PQ46DC6Y.js → chunk-5E7ZMWDF.js} +2 -2
- package/dist/{chunk-BLNOGMIM.cjs → chunk-5FS4IZWY.cjs} +2 -2
- package/dist/chunk-5FS4IZWY.cjs.map +1 -0
- package/dist/{chunk-DOLK5KIS.js → chunk-64DMMXFW.js} +2 -2
- package/dist/{chunk-PMBWFYZQ.js → chunk-6KT4B4QX.js} +2 -2
- package/dist/{chunk-SCJLAOY3.cjs → chunk-6XVQSILN.cjs} +4 -4
- package/dist/chunk-6XVQSILN.cjs.map +1 -0
- package/dist/chunk-DCZVOIEO.cjs.map +1 -1
- package/dist/{chunk-WMM6XVQX.js → chunk-DSCSR6NE.js} +2 -2
- package/dist/{chunk-LWNFAIYG.js → chunk-EGQQVYKL.js} +3 -3
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/chunk-H7OWEYH2.cjs.map +1 -1
- package/dist/{chunk-YFSYLEXO.cjs → chunk-LIG666DX.cjs} +3 -3
- package/dist/chunk-LIG666DX.cjs.map +1 -0
- package/dist/{chunk-GFTAPAJS.js → chunk-N4BFHNLA.js} +2 -2
- package/dist/{chunk-7Z3NHIRR.js → chunk-NVPCKSNL.js} +2 -2
- package/dist/{chunk-E2K4SNMD.js → chunk-O5JOHYCV.js} +2 -2
- package/dist/{chunk-H6O65EPK.js → chunk-QPPOC6OL.js} +2 -2
- package/dist/chunk-QPPOC6OL.js.map +1 -0
- package/dist/{chunk-7KRCQE3P.js → chunk-SYJ6FPPQ.js} +2 -2
- package/dist/{chunk-OBX3VSIZ.js → chunk-TZLLCYDN.js} +2 -2
- package/dist/{chunk-CAA6DVEE.js → chunk-VQ5NQBL2.js} +22 -15
- package/dist/chunk-VQ5NQBL2.js.map +1 -0
- package/dist/{chunk-ZHRYLT3N.js → chunk-YF6JUAM7.js} +3 -3
- package/dist/{chunk-I53FOXZR.js → chunk-YHAB7UP6.js} +2 -2
- package/dist/{chunk-LXUZUUUG.cjs → chunk-ZB3WT7XX.cjs} +9 -9
- package/dist/chunk-ZB3WT7XX.cjs.map +1 -0
- package/dist/chunks-G7YDTLNI.js +10 -0
- package/dist/cli.js +16 -16
- package/dist/formula-SB3NHDUM.cjs.map +1 -1
- package/dist/{image-ocr-HY42AVXC.js → image-ocr-FXLX2GM6.js} +4 -4
- package/dist/{image-ocr-WCIDB6RY.js → image-ocr-WN3UO4UY.js} +4 -4
- package/dist/{image-ocr-JWAX5EOB.cjs → image-ocr-YOUVLJIH.cjs} +9 -9
- package/dist/image-ocr-YOUVLJIH.cjs.map +1 -0
- package/dist/index.cjs +165 -158
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -11
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +14 -14
- package/dist/page-range-P7SDW6LR.cjs.map +1 -1
- package/dist/{parser-6RDEBLSB.cjs → parser-AUMEO4OU.cjs} +24 -24
- package/dist/parser-AUMEO4OU.cjs.map +1 -0
- package/dist/{parser-WRNS6MX2.js → parser-KIXK2IEX.js} +5 -5
- package/dist/{parser-SVZPCCRG.js → parser-KYSMRSMJ.js} +5 -5
- package/dist/pdf-ocr-2QOASWPI.js +12 -0
- package/dist/pdf-ocr-BUKZ5R4P.cjs +13 -0
- package/dist/pdf-ocr-BUKZ5R4P.cjs.map +1 -0
- package/dist/{pdf-ocr-WM3RZMZY.js → pdf-ocr-NQFV46WZ.js} +4 -4
- package/dist/{profile-io-SWGUQSCL.js → profile-io-NKUXEPI4.js} +3 -3
- package/dist/{rasterize-QA7W6QUF.js → rasterize-OT5TROD4.js} +2 -2
- package/dist/render-HQTKZ3ZE.js +10 -0
- package/dist/seal-KH6IL23B.js +10 -0
- package/dist/{watch-SFQNFU7Q.js → watch-6KMSCCM5.js} +8 -8
- package/package.json +1 -1
- package/dist/chunk-BLNOGMIM.cjs.map +0 -1
- package/dist/chunk-CAA6DVEE.js.map +0 -1
- package/dist/chunk-H6O65EPK.js.map +0 -1
- package/dist/chunk-LXUZUUUG.cjs.map +0 -1
- package/dist/chunk-SCJLAOY3.cjs.map +0 -1
- package/dist/chunk-YFSYLEXO.cjs.map +0 -1
- package/dist/chunks-GT45ALC5.js +0 -10
- package/dist/image-ocr-JWAX5EOB.cjs.map +0 -1
- package/dist/parser-6RDEBLSB.cjs.map +0 -1
- package/dist/pdf-ocr-4SGVLUNL.cjs +0 -13
- package/dist/pdf-ocr-4SGVLUNL.cjs.map +0 -1
- package/dist/pdf-ocr-7AAHJOXQ.js +0 -12
- package/dist/render-DRUIPV77.js +0 -10
- package/dist/seal-3M4ZSW66.js +0 -10
- /package/dist/{-2M56QRNH.js.map → -UYYP67I6.js.map} +0 -0
- /package/dist/{chunk-PQ46DC6Y.js.map → chunk-5E7ZMWDF.js.map} +0 -0
- /package/dist/{chunk-DOLK5KIS.js.map → chunk-64DMMXFW.js.map} +0 -0
- /package/dist/{chunk-PMBWFYZQ.js.map → chunk-6KT4B4QX.js.map} +0 -0
- /package/dist/{chunk-WMM6XVQX.js.map → chunk-DSCSR6NE.js.map} +0 -0
- /package/dist/{chunk-LWNFAIYG.js.map → chunk-EGQQVYKL.js.map} +0 -0
- /package/dist/{chunk-GFTAPAJS.js.map → chunk-N4BFHNLA.js.map} +0 -0
- /package/dist/{chunk-7Z3NHIRR.js.map → chunk-NVPCKSNL.js.map} +0 -0
- /package/dist/{chunk-E2K4SNMD.js.map → chunk-O5JOHYCV.js.map} +0 -0
- /package/dist/{chunk-7KRCQE3P.js.map → chunk-SYJ6FPPQ.js.map} +0 -0
- /package/dist/{chunk-OBX3VSIZ.js.map → chunk-TZLLCYDN.js.map} +0 -0
- /package/dist/{chunk-ZHRYLT3N.js.map → chunk-YF6JUAM7.js.map} +0 -0
- /package/dist/{chunk-I53FOXZR.js.map → chunk-YHAB7UP6.js.map} +0 -0
- /package/dist/{chunks-GT45ALC5.js.map → chunks-G7YDTLNI.js.map} +0 -0
- /package/dist/{image-ocr-HY42AVXC.js.map → image-ocr-FXLX2GM6.js.map} +0 -0
- /package/dist/{image-ocr-WCIDB6RY.js.map → image-ocr-WN3UO4UY.js.map} +0 -0
- /package/dist/{parser-WRNS6MX2.js.map → parser-KIXK2IEX.js.map} +0 -0
- /package/dist/{parser-SVZPCCRG.js.map → parser-KYSMRSMJ.js.map} +0 -0
- /package/dist/{pdf-ocr-7AAHJOXQ.js.map → pdf-ocr-2QOASWPI.js.map} +0 -0
- /package/dist/{pdf-ocr-WM3RZMZY.js.map → pdf-ocr-NQFV46WZ.js.map} +0 -0
- /package/dist/{profile-io-SWGUQSCL.js.map → profile-io-NKUXEPI4.js.map} +0 -0
- /package/dist/{rasterize-QA7W6QUF.js.map → rasterize-OT5TROD4.js.map} +0 -0
- /package/dist/{render-DRUIPV77.js.map → render-HQTKZ3ZE.js.map} +0 -0
- /package/dist/{seal-3M4ZSW66.js.map → seal-KH6IL23B.js.map} +0 -0
- /package/dist/{watch-SFQNFU7Q.js.map → watch-6KMSCCM5.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
flattenLayoutTables,
|
|
9
9
|
inlineImagesIntoMarkdown,
|
|
10
10
|
mapPuaText
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5E7ZMWDF.js";
|
|
12
12
|
import {
|
|
13
13
|
parsePageRange
|
|
14
14
|
} from "./chunk-GE43BE46.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
sanitizeHref,
|
|
28
28
|
stripDtd,
|
|
29
29
|
toArrayBuffer
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-TZLLCYDN.js";
|
|
31
31
|
|
|
32
32
|
// src/index.ts
|
|
33
33
|
import { readFile } from "fs/promises";
|
|
@@ -1984,7 +1984,11 @@ function completeTable(newTable, tableStack, blocks, ctx) {
|
|
|
1984
1984
|
cell2.hasStructure = true;
|
|
1985
1985
|
let flat = convertTableToText(newTable.rows);
|
|
1986
1986
|
if (newTable.caption) flat = newTable.caption + (flat ? "\n" + flat : "");
|
|
1987
|
-
if (flat)
|
|
1987
|
+
if (flat) {
|
|
1988
|
+
const inlineJoin = newTable.inline === true && cell2.lineOpen === true;
|
|
1989
|
+
cell2.text += (cell2.text ? inlineJoin ? " " : "\n" : "") + flat;
|
|
1990
|
+
cell2.lineOpen = newTable.inline === true;
|
|
1991
|
+
}
|
|
1988
1992
|
} else {
|
|
1989
1993
|
blocks.push(block);
|
|
1990
1994
|
}
|
|
@@ -2115,6 +2119,7 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
|
|
|
2115
2119
|
}
|
|
2116
2120
|
if (segments) {
|
|
2117
2121
|
const cell2 = tableCtx?.cell ?? null;
|
|
2122
|
+
if (cell2) cell2.lineOpen = false;
|
|
2118
2123
|
const segs = [...segments];
|
|
2119
2124
|
if (ph?.prefix) {
|
|
2120
2125
|
const fi = segs.findIndex((s) => s);
|
|
@@ -2133,7 +2138,8 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
|
|
|
2133
2138
|
if (footnote) block.footnoteText = footnote;
|
|
2134
2139
|
}
|
|
2135
2140
|
if (cell2) {
|
|
2136
|
-
cell2.text += (cell2.text ? "\n" : "") + s;
|
|
2141
|
+
cell2.text += (cell2.text ? cell2.lineOpen ? " " : "\n" : "") + s;
|
|
2142
|
+
cell2.lineOpen = true;
|
|
2137
2143
|
(cell2.blocks ??= []).push(block);
|
|
2138
2144
|
} else blocks.push(block);
|
|
2139
2145
|
};
|
|
@@ -2385,7 +2391,7 @@ function walkParagraphChildren(node, blocks, tableCtx, tableStack, ctx, depth =
|
|
|
2385
2391
|
}
|
|
2386
2392
|
}
|
|
2387
2393
|
if (tableCtx) tableStack.push(tableCtx);
|
|
2388
|
-
const newTable = { rows: [], currentRow: [], cell: null };
|
|
2394
|
+
const newTable = { rows: [], currentRow: [], cell: null, inline: isInlineTbl(el) };
|
|
2389
2395
|
walkSection(el, blocks, newTable, tableStack, ctx, d + 1);
|
|
2390
2396
|
tableCtx = completeTable(newTable, tableStack, blocks, ctx);
|
|
2391
2397
|
} else if (localTag === "caption" && !inShape) {
|
|
@@ -22662,11 +22668,12 @@ ${base2.join("\n")}
|
|
|
22662
22668
|
paraPr(6, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true }),
|
|
22663
22669
|
paraPr(7, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true })
|
|
22664
22670
|
];
|
|
22671
|
+
const listAlign = gongmun.numbering === "gaejosik" || gongmun.numbering === "report" ? "LEFT" : "JUSTIFY";
|
|
22665
22672
|
for (let d = 0; d < GONGMUN_LIST_LEVELS; d++) {
|
|
22666
22673
|
const { left, indent } = levelIndent(d, gongmun.bodyHeight, gongmun.numbering, gongmun.sizes, gongmun.bullet2, usesAsteriskThird(gongmun.preset));
|
|
22667
22674
|
const sectionGap = gongmun.numbering === "gaejosik" || gongmun.numbering === "report" ? gaejosikSpaceBefore(d, gongmun.bodyHeight) : 0;
|
|
22668
22675
|
const keepNext = (gongmun.numbering === "gaejosik" || gongmun.numbering === "report") && d === 0;
|
|
22669
|
-
base.push(paraPr(GONGMUN_LIST_BASE + d, { align:
|
|
22676
|
+
base.push(paraPr(GONGMUN_LIST_BASE + d, { align: listAlign, lineSpacing: ls, left, indent, spaceBefore: sectionGap, keepWord: true, keepWithNext: keepNext }));
|
|
22670
22677
|
}
|
|
22671
22678
|
base.push(paraPr(GONGMUN_CENTER, { align: "CENTER", lineSpacing: ls, keepWord: true }));
|
|
22672
22679
|
base.push(paraPr(GONGMUN_RIGHT, { align: "RIGHT", lineSpacing: ls, keepWord: true }));
|
|
@@ -22676,7 +22683,7 @@ ${base2.join("\n")}
|
|
|
22676
22683
|
const cham = gaejosikChamIndent(gongmun.bodyHeight, gongmun.sizes);
|
|
22677
22684
|
const toc = gaejosikTocItemIndent(gongmun.bodyHeight, gongmun.sizes);
|
|
22678
22685
|
base.push(
|
|
22679
|
-
paraPr(GJ_PARA_CHAM, { align: "
|
|
22686
|
+
paraPr(GJ_PARA_CHAM, { align: "LEFT", lineSpacing: ls, left: cham.left, indent: cham.indent, spaceBefore: gaejosikSpaceBefore(3, gongmun.bodyHeight), keepWord: true }),
|
|
22680
22687
|
paraPr(GJ_PARA_COVER, { align: "CENTER", lineSpacing: 130, keepWord: true }),
|
|
22681
22688
|
paraPr(GJ_PARA_TOC_ITEM, { align: "LEFT", lineSpacing: 160, left: toc.left, indent: toc.indent, spaceBefore: 1800, keepWord: true }),
|
|
22682
22689
|
// 장 헤더는 다음 문단과 같은 쪽에 — 쪽 하단 고아 헤더 방지 (실렌더 확인 이슈)
|
|
@@ -22688,7 +22695,7 @@ ${base2.join("\n")}
|
|
|
22688
22695
|
for (let d = 0; d < GONGMUN_LIST_LEVELS; d++) {
|
|
22689
22696
|
const { left } = levelIndent(d, gongmun.bodyHeight, gongmun.numbering, gongmun.sizes, gongmun.bullet2, usesAsteriskThird(gongmun.preset));
|
|
22690
22697
|
const sectionGap = gongmun.numbering === "gaejosik" || gongmun.numbering === "report" ? gaejosikSpaceBefore(d, gongmun.bodyHeight) : 0;
|
|
22691
|
-
base.push(paraPr(GONGMUN_LIST_PLAIN_BASE + d, { align:
|
|
22698
|
+
base.push(paraPr(GONGMUN_LIST_PLAIN_BASE + d, { align: listAlign, lineSpacing: ls, left, indent: 0, spaceBefore: sectionGap, keepWord: true }));
|
|
22692
22699
|
}
|
|
22693
22700
|
base.push(paraPr(GONGMUN_PARA_APPROVAL, { align: "CENTER", lineSpacing: 100, keepWord: true }));
|
|
22694
22701
|
for (let vi = 0; vi < listIndentVariants.length; vi++) {
|
|
@@ -22696,7 +22703,7 @@ ${base2.join("\n")}
|
|
|
22696
22703
|
const { left } = levelIndent(depth, gongmun.bodyHeight, gongmun.numbering, gongmun.sizes, gongmun.bullet2, usesAsteriskThird(gongmun.preset));
|
|
22697
22704
|
const sectionGap = gongmun.numbering === "gaejosik" || gongmun.numbering === "report" ? gaejosikSpaceBefore(depth, gongmun.bodyHeight) : 0;
|
|
22698
22705
|
const keepNext = (gongmun.numbering === "gaejosik" || gongmun.numbering === "report") && depth === 0;
|
|
22699
|
-
base.push(paraPr(GONGMUN_LIST_VARIANT_BASE + vi, { align:
|
|
22706
|
+
base.push(paraPr(GONGMUN_LIST_VARIANT_BASE + vi, { align: listAlign, lineSpacing: ls, left, indent: -widthHu, spaceBefore: sectionGap, keepWord: true, keepWithNext: keepNext }));
|
|
22700
22707
|
}
|
|
22701
22708
|
assertSequentialIds(base, "paraPr", 0);
|
|
22702
22709
|
return `<hh:paraProperties itemCnt="${base.length}">
|
|
@@ -30558,7 +30565,7 @@ async function parse(input, options) {
|
|
|
30558
30565
|
}
|
|
30559
30566
|
async function parseImage(buffer, options) {
|
|
30560
30567
|
try {
|
|
30561
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
30568
|
+
const { parseImageDocument } = await import("./image-ocr-WN3UO4UY.js");
|
|
30562
30569
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
30563
30570
|
return {
|
|
30564
30571
|
success: true,
|
|
@@ -30616,7 +30623,7 @@ async function parseHwp(buffer, options) {
|
|
|
30616
30623
|
async function parsePdf(buffer, options) {
|
|
30617
30624
|
let parsePdfDocument;
|
|
30618
30625
|
try {
|
|
30619
|
-
const mod = await import("./parser-
|
|
30626
|
+
const mod = await import("./parser-KIXK2IEX.js");
|
|
30620
30627
|
parsePdfDocument = mod.parsePdfDocument;
|
|
30621
30628
|
} catch {
|
|
30622
30629
|
return {
|