kordoc 4.2.3 → 4.2.5
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 +1 -1
- package/dist/{-GJYDKVQD.js → -G2JOUAZU.js} +8 -8
- package/dist/{chunk-FF5QNEKZ.cjs → chunk-4VRGN6MO.cjs} +3 -3
- package/dist/chunk-4VRGN6MO.cjs.map +1 -0
- package/dist/{chunk-LPWP4FWU.js → chunk-6AJGCOCS.js} +2 -2
- package/dist/{chunk-DE6FORIP.js → chunk-CB3HDP4O.js} +2 -2
- package/dist/chunk-DCZVOIEO.cjs.map +1 -1
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/chunk-H7OWEYH2.cjs.map +1 -1
- package/dist/{chunk-U6XYOV32.js → chunk-JZIPR2PJ.js} +2 -2
- package/dist/{chunk-WX75LYAS.js → chunk-L7KFGFDA.js} +22 -14
- package/dist/chunk-L7KFGFDA.js.map +1 -0
- package/dist/{chunk-CWP56BRC.cjs → chunk-LHH7AT6J.cjs} +2 -2
- package/dist/chunk-LHH7AT6J.cjs.map +1 -0
- package/dist/{chunk-5AXGFJQO.cjs → chunk-M4BQRAOM.cjs} +4 -4
- package/dist/chunk-M4BQRAOM.cjs.map +1 -0
- package/dist/{chunk-CGFWS3BQ.js → chunk-NTK7B6EU.js} +3 -3
- package/dist/{chunk-LMNSIPWZ.js → chunk-PEKWJZDQ.js} +2 -2
- package/dist/{chunk-RAS3HM4X.js → chunk-PPRJ3TVL.js} +2 -2
- package/dist/{chunk-NOMNOG74.js → chunk-R5DVJNXY.js} +2 -2
- package/dist/{chunk-WTJIRGPN.js → chunk-SPY7ZVBB.js} +3 -3
- package/dist/{chunk-QNVZAKUQ.js → chunk-TH4YAOOG.js} +2 -2
- package/dist/{chunk-NIPPOAT6.js → chunk-VKVFHF5E.js} +2 -2
- package/dist/{chunk-K5LGSH5T.js → chunk-VSTUPUNH.js} +2 -2
- package/dist/{chunk-AA6UPPZF.cjs → chunk-VUU26FTT.cjs} +9 -9
- package/dist/chunk-VUU26FTT.cjs.map +1 -0
- package/dist/{chunk-ELRVXOMP.js → chunk-WHCDNDDG.js} +2 -2
- package/dist/{chunk-X634MXVJ.js → chunk-XOOQ46DQ.js} +2 -2
- package/dist/chunk-XOOQ46DQ.js.map +1 -0
- package/dist/chunks-ASAY2R5Q.js +10 -0
- package/dist/cli.js +16 -16
- package/dist/formula-SB3NHDUM.cjs.map +1 -1
- package/dist/{image-ocr-O3YQ3KEN.js → image-ocr-C2VYH6L7.js} +4 -4
- package/dist/{image-ocr-PLTV4NOK.js → image-ocr-ILTRLOCF.js} +4 -4
- package/dist/{image-ocr-TCJLNMTG.cjs → image-ocr-RN77CC5P.cjs} +9 -9
- package/dist/image-ocr-RN77CC5P.cjs.map +1 -0
- package/dist/index.cjs +165 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -10
- 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-VQIJPCI5.cjs → parser-5TEQ6EFF.cjs} +24 -24
- package/dist/parser-5TEQ6EFF.cjs.map +1 -0
- package/dist/{parser-Y2X4JMAK.js → parser-7XDK53L6.js} +5 -5
- package/dist/{parser-UX5T6KTZ.js → parser-FDOR727T.js} +5 -5
- package/dist/{pdf-ocr-DOPZP6QS.js → pdf-ocr-4LO224RJ.js} +4 -4
- package/dist/pdf-ocr-5XGZH6D4.cjs +13 -0
- package/dist/pdf-ocr-5XGZH6D4.cjs.map +1 -0
- package/dist/pdf-ocr-ZEKXX54R.js +12 -0
- package/dist/{profile-io-EGVJAZDG.js → profile-io-6SYG2B2L.js} +3 -3
- package/dist/{rasterize-TH26U5E2.js → rasterize-PV7NU33W.js} +2 -2
- package/dist/render-ORPFUHVA.js +10 -0
- package/dist/seal-3AEDWS4F.js +10 -0
- package/dist/{watch-4SP7V6SV.js → watch-ZXCJZTSN.js} +8 -8
- package/package.json +1 -1
- package/dist/chunk-5AXGFJQO.cjs.map +0 -1
- package/dist/chunk-AA6UPPZF.cjs.map +0 -1
- package/dist/chunk-CWP56BRC.cjs.map +0 -1
- package/dist/chunk-FF5QNEKZ.cjs.map +0 -1
- package/dist/chunk-WX75LYAS.js.map +0 -1
- package/dist/chunk-X634MXVJ.js.map +0 -1
- package/dist/chunks-JOGD2KUK.js +0 -10
- package/dist/image-ocr-TCJLNMTG.cjs.map +0 -1
- package/dist/parser-VQIJPCI5.cjs.map +0 -1
- package/dist/pdf-ocr-I3Y6YF5K.js +0 -12
- package/dist/pdf-ocr-XMDJ2IF5.cjs +0 -13
- package/dist/pdf-ocr-XMDJ2IF5.cjs.map +0 -1
- package/dist/render-C4R3OJ45.js +0 -10
- package/dist/seal-JF2J4S52.js +0 -10
- /package/dist/{-GJYDKVQD.js.map → -G2JOUAZU.js.map} +0 -0
- /package/dist/{chunk-LPWP4FWU.js.map → chunk-6AJGCOCS.js.map} +0 -0
- /package/dist/{chunk-DE6FORIP.js.map → chunk-CB3HDP4O.js.map} +0 -0
- /package/dist/{chunk-U6XYOV32.js.map → chunk-JZIPR2PJ.js.map} +0 -0
- /package/dist/{chunk-CGFWS3BQ.js.map → chunk-NTK7B6EU.js.map} +0 -0
- /package/dist/{chunk-LMNSIPWZ.js.map → chunk-PEKWJZDQ.js.map} +0 -0
- /package/dist/{chunk-RAS3HM4X.js.map → chunk-PPRJ3TVL.js.map} +0 -0
- /package/dist/{chunk-NOMNOG74.js.map → chunk-R5DVJNXY.js.map} +0 -0
- /package/dist/{chunk-WTJIRGPN.js.map → chunk-SPY7ZVBB.js.map} +0 -0
- /package/dist/{chunk-QNVZAKUQ.js.map → chunk-TH4YAOOG.js.map} +0 -0
- /package/dist/{chunk-NIPPOAT6.js.map → chunk-VKVFHF5E.js.map} +0 -0
- /package/dist/{chunk-K5LGSH5T.js.map → chunk-VSTUPUNH.js.map} +0 -0
- /package/dist/{chunk-ELRVXOMP.js.map → chunk-WHCDNDDG.js.map} +0 -0
- /package/dist/{chunks-JOGD2KUK.js.map → chunks-ASAY2R5Q.js.map} +0 -0
- /package/dist/{image-ocr-O3YQ3KEN.js.map → image-ocr-C2VYH6L7.js.map} +0 -0
- /package/dist/{image-ocr-PLTV4NOK.js.map → image-ocr-ILTRLOCF.js.map} +0 -0
- /package/dist/{parser-Y2X4JMAK.js.map → parser-7XDK53L6.js.map} +0 -0
- /package/dist/{parser-UX5T6KTZ.js.map → parser-FDOR727T.js.map} +0 -0
- /package/dist/{pdf-ocr-DOPZP6QS.js.map → pdf-ocr-4LO224RJ.js.map} +0 -0
- /package/dist/{pdf-ocr-I3Y6YF5K.js.map → pdf-ocr-ZEKXX54R.js.map} +0 -0
- /package/dist/{profile-io-EGVJAZDG.js.map → profile-io-6SYG2B2L.js.map} +0 -0
- /package/dist/{rasterize-TH26U5E2.js.map → rasterize-PV7NU33W.js.map} +0 -0
- /package/dist/{render-C4R3OJ45.js.map → render-ORPFUHVA.js.map} +0 -0
- /package/dist/{seal-JF2J4S52.js.map → seal-3AEDWS4F.js.map} +0 -0
- /package/dist/{watch-4SP7V6SV.js.map → watch-ZXCJZTSN.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-VSTUPUNH.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-TH4YAOOG.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,7 +2119,7 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
|
|
|
2115
2119
|
}
|
|
2116
2120
|
if (segments) {
|
|
2117
2121
|
const cell2 = tableCtx?.cell ?? null;
|
|
2118
|
-
if (
|
|
2122
|
+
if (cell2) cell2.lineOpen = false;
|
|
2119
2123
|
const segs = [...segments];
|
|
2120
2124
|
if (ph?.prefix) {
|
|
2121
2125
|
const fi = segs.findIndex((s) => s);
|
|
@@ -2133,11 +2137,15 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
|
|
|
2133
2137
|
if (href) block.href = href;
|
|
2134
2138
|
if (footnote) block.footnoteText = footnote;
|
|
2135
2139
|
}
|
|
2136
|
-
if (cell2)
|
|
2137
|
-
|
|
2140
|
+
if (cell2) {
|
|
2141
|
+
cell2.text += (cell2.text ? cell2.lineOpen ? " " : "\n" : "") + s;
|
|
2142
|
+
cell2.lineOpen = true;
|
|
2143
|
+
(cell2.blocks ??= []).push(block);
|
|
2144
|
+
} else blocks.push(block);
|
|
2138
2145
|
};
|
|
2139
2146
|
tableCtx = walkParagraphChildren(el, blocks, tableCtx, tableStack, ctx, depth + 1, flush);
|
|
2140
2147
|
while (segIdx < segs.length) flush();
|
|
2148
|
+
if (footnote && cell2) cell2.text += (cell2.text ? "\n" : "") + `(\uC8FC: ${footnote})`;
|
|
2141
2149
|
break;
|
|
2142
2150
|
}
|
|
2143
2151
|
if (text) {
|
|
@@ -2372,7 +2380,7 @@ function walkParagraphChildren(node, blocks, tableCtx, tableStack, ctx, depth =
|
|
|
2372
2380
|
const tag = el.tagName || el.localName || "";
|
|
2373
2381
|
const localTag = tag.replace(/^[^:]+:/, "");
|
|
2374
2382
|
if (localTag === "tbl") {
|
|
2375
|
-
if (onTbl
|
|
2383
|
+
if (onTbl) onTbl();
|
|
2376
2384
|
if (!tableCtx) {
|
|
2377
2385
|
const chan = kordocTableChannel(el, ctx);
|
|
2378
2386
|
if (chan) {
|
|
@@ -2383,7 +2391,7 @@ function walkParagraphChildren(node, blocks, tableCtx, tableStack, ctx, depth =
|
|
|
2383
2391
|
}
|
|
2384
2392
|
}
|
|
2385
2393
|
if (tableCtx) tableStack.push(tableCtx);
|
|
2386
|
-
const newTable = { rows: [], currentRow: [], cell: null };
|
|
2394
|
+
const newTable = { rows: [], currentRow: [], cell: null, inline: isInlineTbl(el) };
|
|
2387
2395
|
walkSection(el, blocks, newTable, tableStack, ctx, d + 1);
|
|
2388
2396
|
tableCtx = completeTable(newTable, tableStack, blocks, ctx);
|
|
2389
2397
|
} else if (localTag === "caption" && !inShape) {
|
|
@@ -30556,7 +30564,7 @@ async function parse(input, options) {
|
|
|
30556
30564
|
}
|
|
30557
30565
|
async function parseImage(buffer, options) {
|
|
30558
30566
|
try {
|
|
30559
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
30567
|
+
const { parseImageDocument } = await import("./image-ocr-ILTRLOCF.js");
|
|
30560
30568
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
30561
30569
|
return {
|
|
30562
30570
|
success: true,
|
|
@@ -30614,7 +30622,7 @@ async function parseHwp(buffer, options) {
|
|
|
30614
30622
|
async function parsePdf(buffer, options) {
|
|
30615
30623
|
let parsePdfDocument;
|
|
30616
30624
|
try {
|
|
30617
|
-
const mod = await import("./parser-
|
|
30625
|
+
const mod = await import("./parser-7XDK53L6.js");
|
|
30618
30626
|
parsePdfDocument = mod.parsePdfDocument;
|
|
30619
30627
|
} catch {
|
|
30620
30628
|
return {
|