kordoc 4.7.0 → 4.7.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/{-MK2223RL.js → -O42BMYNX.js} +9 -9
- package/dist/{chunk-GIWKBPII.js → chunk-3UIT4PPQ.js} +2 -2
- package/dist/{chunk-MVTX6ODZ.js → chunk-4VNUQYUE.js} +1 -1
- package/dist/chunk-4VNUQYUE.js.map +1 -0
- package/dist/{chunk-6PIR74EA.js → chunk-5KPNXBNR.js} +26 -14
- package/dist/chunk-5KPNXBNR.js.map +1 -0
- package/dist/{chunk-AEYNY6FG.js → chunk-6663UXPE.js} +2 -2
- package/dist/{chunk-AFPD74JJ.js → chunk-7ZIOZ6PU.js} +2 -2
- package/dist/{chunk-XZDJXYUC.js → chunk-AFX6ZXER.js} +2 -2
- package/dist/{chunk-PEVPKD6Z.js → chunk-BQENBAUC.js} +3 -3
- package/dist/{chunk-TUU535RB.cjs → chunk-DJKLOLBT.cjs} +2 -2
- package/dist/chunk-DJKLOLBT.cjs.map +1 -0
- package/dist/{chunk-BCG2PKQU.js → chunk-IMEMTJ76.js} +11 -5
- package/dist/chunk-IMEMTJ76.js.map +1 -0
- package/dist/{chunk-YUVKU5CW.js → chunk-IZEUWEEY.js} +2 -2
- package/dist/chunk-IZEUWEEY.js.map +1 -0
- package/dist/{chunk-ZYVULRYF.js → chunk-J3W6Q3AX.js} +2 -2
- package/dist/{chunk-PV2EXXGI.js → chunk-JEX5P66D.js} +3 -3
- package/dist/{chunk-P2NWNJMR.js → chunk-PLEGO474.js} +2 -2
- package/dist/{chunk-5QTHHQQE.cjs → chunk-TZ3WCAJZ.cjs} +3 -3
- package/dist/{chunk-5QTHHQQE.cjs.map → chunk-TZ3WCAJZ.cjs.map} +1 -1
- package/dist/{chunk-W5KRKBYR.cjs → chunk-USGC3ZKU.cjs} +13 -7
- package/dist/chunk-USGC3ZKU.cjs.map +1 -0
- package/dist/{chunk-YXXHH6WC.js → chunk-UZB3UGC5.js} +2 -2
- package/dist/{chunk-IDHBO6AG.js → chunk-VECVLIWE.js} +3 -3
- package/dist/{chunk-3VTMSSDW.js → chunk-YWDN5PQC.js} +11 -5
- package/dist/chunk-YWDN5PQC.js.map +1 -0
- package/dist/{chunk-C27PPXRZ.cjs → chunk-ZDWP3LLY.cjs} +10 -10
- package/dist/{chunk-C27PPXRZ.cjs.map → chunk-ZDWP3LLY.cjs.map} +1 -1
- package/dist/chunks-C7DJL4RE.js +10 -0
- package/dist/cli.js +17 -17
- package/dist/{image-ocr-4MHEX4MN.js → image-ocr-5QRZBNOF.js} +5 -5
- package/dist/{image-ocr-OB5PCQUU.cjs → image-ocr-MKD6MKWO.cjs} +10 -10
- package/dist/{image-ocr-OB5PCQUU.cjs.map → image-ocr-MKD6MKWO.cjs.map} +1 -1
- package/dist/{image-ocr-3A3HZX6O.js → image-ocr-TAJHRZ5T.js} +4 -4
- package/dist/index.cjs +479 -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 +21 -9
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +15 -15
- package/dist/{parser-EQN4YKU4.js → parser-RCEHB2EV.js} +49 -6
- package/dist/parser-RCEHB2EV.js.map +1 -0
- package/dist/{parser-VACM3DFR.cjs → parser-SWY4RKGD.cjs} +69 -26
- package/dist/parser-SWY4RKGD.cjs.map +1 -0
- package/dist/{parser-EIVCD4NS.js → parser-UMFBJG2D.js} +50 -7
- package/dist/parser-UMFBJG2D.js.map +1 -0
- package/dist/pdf-ocr-3NTV3MYP.js +12 -0
- package/dist/{pdf-ocr-NPYDUIC5.js → pdf-ocr-7BOO4JA7.js} +5 -5
- package/dist/pdf-ocr-JDHELYBY.cjs +13 -0
- package/dist/{pdf-ocr-OBPQ4F4D.cjs.map → pdf-ocr-JDHELYBY.cjs.map} +1 -1
- package/dist/{profile-io-L5EH4JAD.js → profile-io-HT62OAEU.js} +3 -3
- package/dist/{rasterize-7AR662AL.js → rasterize-GL67HQC7.js} +2 -2
- package/dist/render-IQ4IZLY4.js +10 -0
- package/dist/seal-AGSZ6MUR.js +10 -0
- package/dist/{watch-MONT6CGI.js → watch-5ST75Q7Q.js} +9 -9
- package/package.json +1 -1
- package/dist/chunk-3VTMSSDW.js.map +0 -1
- package/dist/chunk-6PIR74EA.js.map +0 -1
- package/dist/chunk-BCG2PKQU.js.map +0 -1
- package/dist/chunk-MVTX6ODZ.js.map +0 -1
- package/dist/chunk-TUU535RB.cjs.map +0 -1
- package/dist/chunk-W5KRKBYR.cjs.map +0 -1
- package/dist/chunk-YUVKU5CW.js.map +0 -1
- package/dist/chunks-4HEG6ZPG.js +0 -10
- 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-OBPQ4F4D.cjs +0 -13
- package/dist/render-CAFQT7S4.js +0 -10
- package/dist/seal-ESAC3IZR.js +0 -10
- /package/dist/{-MK2223RL.js.map → -O42BMYNX.js.map} +0 -0
- /package/dist/{chunk-GIWKBPII.js.map → chunk-3UIT4PPQ.js.map} +0 -0
- /package/dist/{chunk-AEYNY6FG.js.map → chunk-6663UXPE.js.map} +0 -0
- /package/dist/{chunk-AFPD74JJ.js.map → chunk-7ZIOZ6PU.js.map} +0 -0
- /package/dist/{chunk-XZDJXYUC.js.map → chunk-AFX6ZXER.js.map} +0 -0
- /package/dist/{chunk-PEVPKD6Z.js.map → chunk-BQENBAUC.js.map} +0 -0
- /package/dist/{chunk-ZYVULRYF.js.map → chunk-J3W6Q3AX.js.map} +0 -0
- /package/dist/{chunk-PV2EXXGI.js.map → chunk-JEX5P66D.js.map} +0 -0
- /package/dist/{chunk-P2NWNJMR.js.map → chunk-PLEGO474.js.map} +0 -0
- /package/dist/{chunk-YXXHH6WC.js.map → chunk-UZB3UGC5.js.map} +0 -0
- /package/dist/{chunk-IDHBO6AG.js.map → chunk-VECVLIWE.js.map} +0 -0
- /package/dist/{chunks-4HEG6ZPG.js.map → chunks-C7DJL4RE.js.map} +0 -0
- /package/dist/{image-ocr-4MHEX4MN.js.map → image-ocr-5QRZBNOF.js.map} +0 -0
- /package/dist/{image-ocr-3A3HZX6O.js.map → image-ocr-TAJHRZ5T.js.map} +0 -0
- /package/dist/{pdf-ocr-N62EWEX4.js.map → pdf-ocr-3NTV3MYP.js.map} +0 -0
- /package/dist/{pdf-ocr-NPYDUIC5.js.map → pdf-ocr-7BOO4JA7.js.map} +0 -0
- /package/dist/{profile-io-L5EH4JAD.js.map → profile-io-HT62OAEU.js.map} +0 -0
- /package/dist/{rasterize-7AR662AL.js.map → rasterize-GL67HQC7.js.map} +0 -0
- /package/dist/{render-CAFQT7S4.js.map → render-IQ4IZLY4.js.map} +0 -0
- /package/dist/{seal-ESAC3IZR.js.map → seal-AGSZ6MUR.js.map} +0 -0
- /package/dist/{watch-MONT6CGI.js.map → watch-5ST75Q7Q.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,7 +8,7 @@ import {
|
|
|
8
8
|
flattenLayoutTables,
|
|
9
9
|
inlineImagesIntoMarkdown,
|
|
10
10
|
mapPuaText
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IMEMTJ76.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-IZEUWEEY.js";
|
|
31
31
|
|
|
32
32
|
// src/index.ts
|
|
33
33
|
import { readFile } from "fs/promises";
|
|
@@ -680,6 +680,8 @@ function parseCharProperties(doc, map) {
|
|
|
680
680
|
else if (localTag === "strikeout") {
|
|
681
681
|
const shape = k.getAttribute("shape") || "";
|
|
682
682
|
if (isRealStrikeShape(shape)) prop.strike = true;
|
|
683
|
+
} else if (localTag === "underline") {
|
|
684
|
+
if (k.getAttribute("type") === "BOTTOM") prop.underline = true;
|
|
683
685
|
}
|
|
684
686
|
}
|
|
685
687
|
const fontFaces = el.getElementsByTagName("*");
|
|
@@ -2378,21 +2380,22 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
|
|
|
2378
2380
|
if (cp?.bold) span.bold = true;
|
|
2379
2381
|
if (cp?.italic) span.italic = true;
|
|
2380
2382
|
if (cp?.strike) span.strike = true;
|
|
2383
|
+
if (cp?.underline) span.underline = true;
|
|
2381
2384
|
}
|
|
2382
|
-
if (span.bold || span.italic || span.strike || span.code) styled = true;
|
|
2385
|
+
if (span.bold || span.italic || span.strike || span.underline || span.code) styled = true;
|
|
2383
2386
|
spans.push(span);
|
|
2384
2387
|
}
|
|
2385
2388
|
if (!styled || spans.length === 0) return null;
|
|
2386
2389
|
const merged = [];
|
|
2387
2390
|
for (const s of spans) {
|
|
2388
2391
|
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) {
|
|
2392
|
+
if (last && !!last.bold === !!s.bold && !!last.italic === !!s.italic && !!last.strike === !!s.strike && !!last.underline === !!s.underline && !!last.code === !!s.code) {
|
|
2390
2393
|
last.text += s.text;
|
|
2391
2394
|
} else {
|
|
2392
2395
|
merged.push(s);
|
|
2393
2396
|
}
|
|
2394
2397
|
}
|
|
2395
|
-
if (requireMixed && !merged.some((s) => s.strike) && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
|
|
2398
|
+
if (requireMixed && !merged.some((s) => s.strike || s.underline) && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
|
|
2396
2399
|
return merged;
|
|
2397
2400
|
}
|
|
2398
2401
|
function gongmunDepthFromIndent(para2, left, ctx) {
|
|
@@ -4744,7 +4747,11 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
4744
4747
|
const style = resolveCharStyle(charShapeIds, ctx.docInfo);
|
|
4745
4748
|
if (style) {
|
|
4746
4749
|
block.style = style;
|
|
4747
|
-
if (style.strike
|
|
4750
|
+
if (style.strike || style.underline) {
|
|
4751
|
+
let deco = style.strike ? `~~${trimmed}~~` : trimmed;
|
|
4752
|
+
if (style.underline) deco = `<u>${deco}</u>`;
|
|
4753
|
+
block.text = headMarker ? `${headMarker} ${deco}` : deco;
|
|
4754
|
+
}
|
|
4748
4755
|
}
|
|
4749
4756
|
}
|
|
4750
4757
|
if (footnotes.length > 0) block.footnoteText = footnotes.join("; ");
|
|
@@ -5137,13 +5144,17 @@ function resolveCharStyle(charShapeIds, docInfo) {
|
|
|
5137
5144
|
if (cs.attrFlags & 1) style.italic = true;
|
|
5138
5145
|
if (cs.attrFlags & 2) style.bold = true;
|
|
5139
5146
|
if (hasRealStrike(cs.attrFlags)) style.strike = true;
|
|
5140
|
-
|
|
5147
|
+
if (hasRealUnderline(cs.attrFlags)) style.underline = true;
|
|
5148
|
+
return style.fontSize || style.bold || style.italic || style.strike || style.underline ? style : void 0;
|
|
5141
5149
|
}
|
|
5142
5150
|
function hasRealStrike(attrFlags) {
|
|
5143
5151
|
const strikeBits = attrFlags >> 18 & 7;
|
|
5144
5152
|
const shapeId = attrFlags >> 26 & 15;
|
|
5145
5153
|
return strikeBits !== 0 && shapeId <= 12;
|
|
5146
5154
|
}
|
|
5155
|
+
function hasRealUnderline(attrFlags) {
|
|
5156
|
+
return (attrFlags >> 2 & 3) === 1;
|
|
5157
|
+
}
|
|
5147
5158
|
|
|
5148
5159
|
// src/hwp3/parser.ts
|
|
5149
5160
|
import { inflateRawSync as inflateRawSync5 } from "zlib";
|
|
@@ -22878,6 +22889,7 @@ function parseInlineMarkdown(text) {
|
|
|
22878
22889
|
});
|
|
22879
22890
|
text = text.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1");
|
|
22880
22891
|
text = text.replace(/~~([^~]+)~~/g, "$1");
|
|
22892
|
+
text = text.replace(/<u>([^<]*)<\/u>/g, "$1");
|
|
22881
22893
|
let spans;
|
|
22882
22894
|
if (inlineDoc) {
|
|
22883
22895
|
spans = [];
|
|
@@ -31312,7 +31324,7 @@ async function parse(input, options) {
|
|
|
31312
31324
|
}
|
|
31313
31325
|
async function parseImage(buffer, options) {
|
|
31314
31326
|
try {
|
|
31315
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
31327
|
+
const { parseImageDocument } = await import("./image-ocr-TAJHRZ5T.js");
|
|
31316
31328
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
31317
31329
|
return {
|
|
31318
31330
|
success: true,
|
|
@@ -31371,7 +31383,7 @@ async function parseHwp(buffer, options) {
|
|
|
31371
31383
|
async function parsePdf(buffer, options) {
|
|
31372
31384
|
let parsePdfDocument;
|
|
31373
31385
|
try {
|
|
31374
|
-
const mod = await import("./parser-
|
|
31386
|
+
const mod = await import("./parser-RCEHB2EV.js");
|
|
31375
31387
|
parsePdfDocument = mod.parsePdfDocument;
|
|
31376
31388
|
} catch {
|
|
31377
31389
|
return {
|