kordoc 4.7.0 → 4.7.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/README.md +14 -0
- package/dist/{-MK2223RL.js → -CVPGGSAB.js} +9 -9
- package/dist/{chunk-W5KRKBYR.cjs → chunk-46VU6YXF.cjs} +13 -7
- package/dist/chunk-46VU6YXF.cjs.map +1 -0
- package/dist/{chunk-MVTX6ODZ.js → chunk-4VNUQYUE.js} +1 -1
- package/dist/chunk-4VNUQYUE.js.map +1 -0
- package/dist/{chunk-GIWKBPII.js → chunk-7CWNBDWQ.js} +5 -3
- package/dist/{chunk-GIWKBPII.js.map → chunk-7CWNBDWQ.js.map} +1 -1
- package/dist/{chunk-XZDJXYUC.js → chunk-BSWJCSG7.js} +2 -2
- package/dist/chunk-DCZVOIEO.cjs.map +1 -1
- package/dist/{chunk-TUU535RB.cjs → chunk-DZBMQC2N.cjs} +3 -11
- package/dist/chunk-DZBMQC2N.cjs.map +1 -0
- package/dist/{chunk-C27PPXRZ.cjs → chunk-E2XTVK7H.cjs} +12 -10
- package/dist/chunk-E2XTVK7H.cjs.map +1 -0
- package/dist/{chunk-PV2EXXGI.js → chunk-FJBOVJAG.js} +3 -3
- package/dist/{chunk-P2NWNJMR.js → chunk-GLZMUKYL.js} +3 -3
- package/dist/chunk-GS7T56RP.cjs.map +1 -1
- package/dist/chunk-I4TP7HYB.js +11 -0
- package/dist/chunk-I4TP7HYB.js.map +1 -0
- package/dist/{chunk-GZDOWYJM.js → chunk-IMY4LQ3J.js} +2 -2
- package/dist/{chunk-IDHBO6AG.js → chunk-IN2AOMX6.js} +3 -3
- package/dist/{chunk-PEVPKD6Z.js → chunk-IVSEGHI2.js} +3 -3
- package/dist/{chunk-YUVKU5CW.js → chunk-JMWBMGNH.js} +3 -11
- package/dist/chunk-JMWBMGNH.js.map +1 -0
- package/dist/{chunk-AFPD74JJ.js → chunk-LJW5EQXS.js} +2 -2
- package/dist/{chunk-YXXHH6WC.js → chunk-O4VLHQVG.js} +2 -2
- package/dist/{chunk-3VTMSSDW.js → chunk-P7HPLWEP.js} +11 -5
- package/dist/chunk-P7HPLWEP.js.map +1 -0
- package/dist/{chunk-BCG2PKQU.js → chunk-PGDJUJ4L.js} +11 -5
- package/dist/chunk-PGDJUJ4L.js.map +1 -0
- package/dist/{chunk-ZV5OKQ3Z.cjs → chunk-PV6WSN6E.cjs} +28 -2
- package/dist/chunk-PV6WSN6E.cjs.map +1 -0
- package/dist/{chunk-UAFSPWU7.js → chunk-QKHN7LEV.js} +8 -1
- package/dist/chunk-QKHN7LEV.js.map +1 -0
- package/dist/{chunk-6PIR74EA.js → chunk-QXC5NPO2.js} +26 -14
- package/dist/chunk-QXC5NPO2.js.map +1 -0
- package/dist/chunk-TYIFZT5H.js +52 -0
- package/dist/chunk-TYIFZT5H.js.map +1 -0
- package/dist/chunk-URTDBXV6.cjs +11 -0
- package/dist/chunk-URTDBXV6.cjs.map +1 -0
- package/dist/{chunk-AEYNY6FG.js → chunk-VEBTOI3I.js} +3 -3
- package/dist/{chunk-ZYVULRYF.js → chunk-VXB52EWX.js} +2 -2
- package/dist/{chunk-3H5X63BQ.js → chunk-Y3VDFFAW.js} +27 -1
- package/dist/chunk-Y3VDFFAW.js.map +1 -0
- package/dist/{chunk-5QTHHQQE.cjs → chunk-YU3PLOX4.cjs} +6 -6
- package/dist/chunk-YU3PLOX4.cjs.map +1 -0
- package/dist/chunks-RNP6VLGK.js +10 -0
- package/dist/cli.js +56 -20
- package/dist/cli.js.map +1 -1
- package/dist/{formula-CG4S7TWO.cjs → formula-7D3MLOSV.cjs} +9 -8
- package/dist/formula-7D3MLOSV.cjs.map +1 -0
- package/dist/{formula-LIVQSCMM.js → formula-GHGK7T3S.js} +3 -2
- package/dist/{formula-JLYS73QL.js → formula-RTGCS55B.js} +4 -2
- package/dist/{formula-LIVQSCMM.js.map → formula-RTGCS55B.js.map} +1 -1
- package/dist/{image-ocr-4MHEX4MN.js → image-ocr-2UMWFGRS.js} +10 -9
- package/dist/{image-ocr-4MHEX4MN.js.map → image-ocr-2UMWFGRS.js.map} +1 -1
- package/dist/{image-ocr-OB5PCQUU.cjs → image-ocr-PRI2JKDW.cjs} +12 -11
- package/dist/image-ocr-PRI2JKDW.cjs.map +1 -0
- package/dist/{image-ocr-3A3HZX6O.js → image-ocr-TQ5THN35.js} +6 -5
- package/dist/{image-ocr-3A3HZX6O.js.map → image-ocr-TQ5THN35.js.map} +1 -1
- package/dist/index.cjs +481 -467
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +24 -10
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +33 -16
- package/dist/mcp.js.map +1 -1
- package/dist/model-bundle-5RLZV7P2.js +104 -0
- package/dist/model-bundle-5RLZV7P2.js.map +1 -0
- package/dist/{models-6SIKLKRH.js → models-RSHR2BY7.js} +5 -3
- package/dist/page-range-P7SDW6LR.cjs.map +1 -1
- package/dist/{parser-EQN4YKU4.js → parser-FXEIK3VJ.js} +51 -7
- package/dist/parser-FXEIK3VJ.js.map +1 -0
- package/dist/{parser-EIVCD4NS.js → parser-QPMTNRPU.js} +51 -8
- package/dist/parser-QPMTNRPU.js.map +1 -0
- package/dist/{parser-VACM3DFR.cjs → parser-SCQ7NJUJ.cjs} +71 -27
- package/dist/parser-SCQ7NJUJ.cjs.map +1 -0
- package/dist/pdf-ocr-HPRM24SP.js +16 -0
- package/dist/pdf-ocr-I6DISTBR.js +13 -0
- package/dist/pdf-ocr-JNWL65YW.cjs +14 -0
- package/dist/pdf-ocr-JNWL65YW.cjs.map +1 -0
- package/dist/{profile-io-L5EH4JAD.js → profile-io-I4UGTNP6.js} +3 -3
- package/dist/{rasterize-7AR662AL.js → rasterize-QY3XJKCH.js} +2 -2
- package/dist/render-HEQX5DII.js +10 -0
- package/dist/seal-NB2YJ5F4.js +10 -0
- package/dist/{setup-GUQT5ELJ.js → setup-T2BY3VME.js} +30 -7
- package/dist/setup-T2BY3VME.js.map +1 -0
- package/dist/{watch-MONT6CGI.js → watch-JJE2UGVK.js} +13 -9
- package/dist/watch-JJE2UGVK.js.map +1 -0
- package/package.json +7 -3
- package/dist/chunk-3H5X63BQ.js.map +0 -1
- package/dist/chunk-3VTMSSDW.js.map +0 -1
- package/dist/chunk-5QTHHQQE.cjs.map +0 -1
- package/dist/chunk-6PIR74EA.js.map +0 -1
- package/dist/chunk-BCG2PKQU.js.map +0 -1
- package/dist/chunk-C27PPXRZ.cjs.map +0 -1
- package/dist/chunk-MVTX6ODZ.js.map +0 -1
- package/dist/chunk-TUU535RB.cjs.map +0 -1
- package/dist/chunk-UAFSPWU7.js.map +0 -1
- package/dist/chunk-W5KRKBYR.cjs.map +0 -1
- package/dist/chunk-YUVKU5CW.js.map +0 -1
- package/dist/chunk-ZV5OKQ3Z.cjs.map +0 -1
- package/dist/chunks-4HEG6ZPG.js +0 -10
- package/dist/formula-CG4S7TWO.cjs.map +0 -1
- package/dist/image-ocr-OB5PCQUU.cjs.map +0 -1
- package/dist/parser-EIVCD4NS.js.map +0 -1
- package/dist/parser-EQN4YKU4.js.map +0 -1
- package/dist/parser-VACM3DFR.cjs.map +0 -1
- package/dist/pdf-ocr-N62EWEX4.js +0 -12
- package/dist/pdf-ocr-NPYDUIC5.js +0 -15
- package/dist/pdf-ocr-OBPQ4F4D.cjs +0 -13
- package/dist/pdf-ocr-OBPQ4F4D.cjs.map +0 -1
- package/dist/render-CAFQT7S4.js +0 -10
- package/dist/seal-ESAC3IZR.js +0 -10
- package/dist/setup-GUQT5ELJ.js.map +0 -1
- package/dist/watch-MONT6CGI.js.map +0 -1
- /package/dist/{-MK2223RL.js.map → -CVPGGSAB.js.map} +0 -0
- /package/dist/{chunk-XZDJXYUC.js.map → chunk-BSWJCSG7.js.map} +0 -0
- /package/dist/{chunk-PV2EXXGI.js.map → chunk-FJBOVJAG.js.map} +0 -0
- /package/dist/{chunk-P2NWNJMR.js.map → chunk-GLZMUKYL.js.map} +0 -0
- /package/dist/{chunk-GZDOWYJM.js.map → chunk-IMY4LQ3J.js.map} +0 -0
- /package/dist/{chunk-IDHBO6AG.js.map → chunk-IN2AOMX6.js.map} +0 -0
- /package/dist/{chunk-PEVPKD6Z.js.map → chunk-IVSEGHI2.js.map} +0 -0
- /package/dist/{chunk-AFPD74JJ.js.map → chunk-LJW5EQXS.js.map} +0 -0
- /package/dist/{chunk-YXXHH6WC.js.map → chunk-O4VLHQVG.js.map} +0 -0
- /package/dist/{chunk-AEYNY6FG.js.map → chunk-VEBTOI3I.js.map} +0 -0
- /package/dist/{chunk-ZYVULRYF.js.map → chunk-VXB52EWX.js.map} +0 -0
- /package/dist/{chunks-4HEG6ZPG.js.map → chunks-RNP6VLGK.js.map} +0 -0
- /package/dist/{formula-JLYS73QL.js.map → formula-GHGK7T3S.js.map} +0 -0
- /package/dist/{models-6SIKLKRH.js.map → models-RSHR2BY7.js.map} +0 -0
- /package/dist/{pdf-ocr-N62EWEX4.js.map → pdf-ocr-HPRM24SP.js.map} +0 -0
- /package/dist/{pdf-ocr-NPYDUIC5.js.map → pdf-ocr-I6DISTBR.js.map} +0 -0
- /package/dist/{profile-io-L5EH4JAD.js.map → profile-io-I4UGTNP6.js.map} +0 -0
- /package/dist/{rasterize-7AR662AL.js.map → rasterize-QY3XJKCH.js.map} +0 -0
- /package/dist/{render-CAFQT7S4.js.map → render-HEQX5DII.js.map} +0 -0
- /package/dist/{seal-ESAC3IZR.js.map → seal-NB2YJ5F4.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -16,6 +16,8 @@ interface IRSpan {
|
|
|
16
16
|
bold?: boolean;
|
|
17
17
|
italic?: boolean;
|
|
18
18
|
strike?: boolean;
|
|
19
|
+
/** 밑줄 — 개정문 추가·변경 표시 등. GFM 문법이 없어 <u>…</u> 인라인 HTML 로 방출 */
|
|
20
|
+
underline?: boolean;
|
|
19
21
|
code?: boolean;
|
|
20
22
|
}
|
|
21
23
|
interface IRBlock {
|
|
@@ -81,6 +83,8 @@ interface InlineStyle {
|
|
|
81
83
|
italic?: boolean;
|
|
82
84
|
/** 취소선 — 법령 개정문 등의 삭제 표시. 판정은 취소선 모양 whitelist (비트만 믿으면 오탐) */
|
|
83
85
|
strike?: boolean;
|
|
86
|
+
/** 밑줄 — 판정은 밑줄 종류 BOTTOM 한정 (NONE 이 기본 잡음, 코퍼스 실측) */
|
|
87
|
+
underline?: boolean;
|
|
84
88
|
fontSize?: number;
|
|
85
89
|
fontName?: string;
|
|
86
90
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ interface IRSpan {
|
|
|
16
16
|
bold?: boolean;
|
|
17
17
|
italic?: boolean;
|
|
18
18
|
strike?: boolean;
|
|
19
|
+
/** 밑줄 — 개정문 추가·변경 표시 등. GFM 문법이 없어 <u>…</u> 인라인 HTML 로 방출 */
|
|
20
|
+
underline?: boolean;
|
|
19
21
|
code?: boolean;
|
|
20
22
|
}
|
|
21
23
|
interface IRBlock {
|
|
@@ -81,6 +83,8 @@ interface InlineStyle {
|
|
|
81
83
|
italic?: boolean;
|
|
82
84
|
/** 취소선 — 법령 개정문 등의 삭제 표시. 판정은 취소선 모양 whitelist (비트만 믿으면 오탐) */
|
|
83
85
|
strike?: boolean;
|
|
86
|
+
/** 밑줄 — 판정은 밑줄 종류 BOTTOM 한정 (NONE 이 기본 잡음, 코퍼스 실측) */
|
|
87
|
+
underline?: boolean;
|
|
84
88
|
fontSize?: number;
|
|
85
89
|
fontName?: string;
|
|
86
90
|
}
|
package/dist/index.js
CHANGED
|
@@ -8,14 +8,16 @@ import {
|
|
|
8
8
|
flattenLayoutTables,
|
|
9
9
|
inlineImagesIntoMarkdown,
|
|
10
10
|
mapPuaText
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PGDJUJ4L.js";
|
|
12
12
|
import {
|
|
13
13
|
parsePageRange
|
|
14
14
|
} from "./chunk-GE43BE46.js";
|
|
15
15
|
import {
|
|
16
16
|
HEADING_RATIO_H1,
|
|
17
17
|
HEADING_RATIO_H2,
|
|
18
|
-
HEADING_RATIO_H3
|
|
18
|
+
HEADING_RATIO_H3
|
|
19
|
+
} from "./chunk-I4TP7HYB.js";
|
|
20
|
+
import {
|
|
19
21
|
KordocError,
|
|
20
22
|
VERSION,
|
|
21
23
|
classifyError,
|
|
@@ -27,7 +29,7 @@ import {
|
|
|
27
29
|
sanitizeHref,
|
|
28
30
|
stripDtd,
|
|
29
31
|
toArrayBuffer
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-JMWBMGNH.js";
|
|
31
33
|
|
|
32
34
|
// src/index.ts
|
|
33
35
|
import { readFile } from "fs/promises";
|
|
@@ -680,6 +682,8 @@ function parseCharProperties(doc, map) {
|
|
|
680
682
|
else if (localTag === "strikeout") {
|
|
681
683
|
const shape = k.getAttribute("shape") || "";
|
|
682
684
|
if (isRealStrikeShape(shape)) prop.strike = true;
|
|
685
|
+
} else if (localTag === "underline") {
|
|
686
|
+
if (k.getAttribute("type") === "BOTTOM") prop.underline = true;
|
|
683
687
|
}
|
|
684
688
|
}
|
|
685
689
|
const fontFaces = el.getElementsByTagName("*");
|
|
@@ -2378,21 +2382,22 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
|
|
|
2378
2382
|
if (cp?.bold) span.bold = true;
|
|
2379
2383
|
if (cp?.italic) span.italic = true;
|
|
2380
2384
|
if (cp?.strike) span.strike = true;
|
|
2385
|
+
if (cp?.underline) span.underline = true;
|
|
2381
2386
|
}
|
|
2382
|
-
if (span.bold || span.italic || span.strike || span.code) styled = true;
|
|
2387
|
+
if (span.bold || span.italic || span.strike || span.underline || span.code) styled = true;
|
|
2383
2388
|
spans.push(span);
|
|
2384
2389
|
}
|
|
2385
2390
|
if (!styled || spans.length === 0) return null;
|
|
2386
2391
|
const merged = [];
|
|
2387
2392
|
for (const s of spans) {
|
|
2388
2393
|
const last = merged[merged.length - 1];
|
|
2389
|
-
if (last && !!last.bold === !!s.bold && !!last.italic === !!s.italic && !!last.strike === !!s.strike && !!last.code === !!s.code) {
|
|
2394
|
+
if (last && !!last.bold === !!s.bold && !!last.italic === !!s.italic && !!last.strike === !!s.strike && !!last.underline === !!s.underline && !!last.code === !!s.code) {
|
|
2390
2395
|
last.text += s.text;
|
|
2391
2396
|
} else {
|
|
2392
2397
|
merged.push(s);
|
|
2393
2398
|
}
|
|
2394
2399
|
}
|
|
2395
|
-
if (requireMixed && !merged.some((s) => s.strike) && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
|
|
2400
|
+
if (requireMixed && !merged.some((s) => s.strike || s.underline) && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
|
|
2396
2401
|
return merged;
|
|
2397
2402
|
}
|
|
2398
2403
|
function gongmunDepthFromIndent(para2, left, ctx) {
|
|
@@ -4744,7 +4749,11 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
4744
4749
|
const style = resolveCharStyle(charShapeIds, ctx.docInfo);
|
|
4745
4750
|
if (style) {
|
|
4746
4751
|
block.style = style;
|
|
4747
|
-
if (style.strike
|
|
4752
|
+
if (style.strike || style.underline) {
|
|
4753
|
+
let deco = style.strike ? `~~${trimmed}~~` : trimmed;
|
|
4754
|
+
if (style.underline) deco = `<u>${deco}</u>`;
|
|
4755
|
+
block.text = headMarker ? `${headMarker} ${deco}` : deco;
|
|
4756
|
+
}
|
|
4748
4757
|
}
|
|
4749
4758
|
}
|
|
4750
4759
|
if (footnotes.length > 0) block.footnoteText = footnotes.join("; ");
|
|
@@ -5137,13 +5146,17 @@ function resolveCharStyle(charShapeIds, docInfo) {
|
|
|
5137
5146
|
if (cs.attrFlags & 1) style.italic = true;
|
|
5138
5147
|
if (cs.attrFlags & 2) style.bold = true;
|
|
5139
5148
|
if (hasRealStrike(cs.attrFlags)) style.strike = true;
|
|
5140
|
-
|
|
5149
|
+
if (hasRealUnderline(cs.attrFlags)) style.underline = true;
|
|
5150
|
+
return style.fontSize || style.bold || style.italic || style.strike || style.underline ? style : void 0;
|
|
5141
5151
|
}
|
|
5142
5152
|
function hasRealStrike(attrFlags) {
|
|
5143
5153
|
const strikeBits = attrFlags >> 18 & 7;
|
|
5144
5154
|
const shapeId = attrFlags >> 26 & 15;
|
|
5145
5155
|
return strikeBits !== 0 && shapeId <= 12;
|
|
5146
5156
|
}
|
|
5157
|
+
function hasRealUnderline(attrFlags) {
|
|
5158
|
+
return (attrFlags >> 2 & 3) === 1;
|
|
5159
|
+
}
|
|
5147
5160
|
|
|
5148
5161
|
// src/hwp3/parser.ts
|
|
5149
5162
|
import { inflateRawSync as inflateRawSync5 } from "zlib";
|
|
@@ -22878,6 +22891,7 @@ function parseInlineMarkdown(text) {
|
|
|
22878
22891
|
});
|
|
22879
22892
|
text = text.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1");
|
|
22880
22893
|
text = text.replace(/~~([^~]+)~~/g, "$1");
|
|
22894
|
+
text = text.replace(/<u>([^<]*)<\/u>/g, "$1");
|
|
22881
22895
|
let spans;
|
|
22882
22896
|
if (inlineDoc) {
|
|
22883
22897
|
spans = [];
|
|
@@ -31312,7 +31326,7 @@ async function parse(input, options) {
|
|
|
31312
31326
|
}
|
|
31313
31327
|
async function parseImage(buffer, options) {
|
|
31314
31328
|
try {
|
|
31315
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
31329
|
+
const { parseImageDocument } = await import("./image-ocr-TQ5THN35.js");
|
|
31316
31330
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
31317
31331
|
return {
|
|
31318
31332
|
success: true,
|
|
@@ -31371,7 +31385,7 @@ async function parseHwp(buffer, options) {
|
|
|
31371
31385
|
async function parsePdf(buffer, options) {
|
|
31372
31386
|
let parsePdfDocument;
|
|
31373
31387
|
try {
|
|
31374
|
-
const mod = await import("./parser-
|
|
31388
|
+
const mod = await import("./parser-FXEIK3VJ.js");
|
|
31375
31389
|
parsePdfDocument = mod.parsePdfDocument;
|
|
31376
31390
|
} catch {
|
|
31377
31391
|
return {
|