kordoc 4.21.22 → 4.21.23
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 +2 -1
- package/dist/{-PLOEMNCA.js → -FLEBKE6V.js} +25 -25
- package/dist/{chunk-6LJ22335.js → chunk-2S37CQUJ.js} +21 -21
- package/dist/{chunk-NT4LPP2I.js → chunk-4F6OVO2A.js} +122 -46
- package/dist/chunk-4F6OVO2A.js.map +1 -0
- package/dist/{chunk-BMQATDUY.js → chunk-75J4Y5ZQ.js} +2 -2
- package/dist/{chunk-7TLZ56ZK.js → chunk-7MTKOSAF.js} +2 -2
- package/dist/{chunk-SQSGBKCL.js → chunk-C3RR6Z3M.js} +3 -3
- package/dist/{chunk-6Z4NAN36.js → chunk-CA742RMF.js} +4 -4
- package/dist/{chunk-M5SPGZKY.js → chunk-DACTHSPR.js} +2 -2
- package/dist/{chunk-LNKHTD47.cjs → chunk-EGYLKSA4.cjs} +13 -13
- package/dist/{chunk-LNKHTD47.cjs.map → chunk-EGYLKSA4.cjs.map} +1 -1
- package/dist/{chunk-H5Q6J2MB.cjs → chunk-EVPP2BSO.cjs} +6 -6
- package/dist/{chunk-H5Q6J2MB.cjs.map → chunk-EVPP2BSO.cjs.map} +1 -1
- package/dist/{chunk-SZM6BSK4.cjs → chunk-GELBKBGQ.cjs} +22 -22
- package/dist/{chunk-SZM6BSK4.cjs.map → chunk-GELBKBGQ.cjs.map} +1 -1
- package/dist/{chunk-64MCJ5GC.js → chunk-GNIOEZDG.js} +2 -2
- package/dist/{chunk-3BJW5KXR.js → chunk-GPIMKPEI.js} +2 -2
- package/dist/{chunk-QSOWCFOV.cjs → chunk-GUU7OHIH.cjs} +2 -2
- package/dist/{chunk-QSOWCFOV.cjs.map → chunk-GUU7OHIH.cjs.map} +1 -1
- package/dist/{chunk-G4DVIZTZ.js → chunk-J25WF6DP.js} +2 -2
- package/dist/{chunk-H6EXISSP.js → chunk-JA4ZWCYL.js} +3 -3
- package/dist/{chunk-LZVOL2H2.js → chunk-JLG7KK4M.js} +2 -2
- package/dist/{chunk-PY72S2AG.js → chunk-JUA7IACQ.js} +2 -2
- package/dist/{chunk-GYQGKVTQ.js → chunk-L4NFUEWJ.js} +4 -4
- package/dist/{chunk-PQW2RPZZ.js → chunk-QRIGJUOQ.js} +26 -25
- package/dist/chunk-QRIGJUOQ.js.map +1 -0
- package/dist/{chunk-EL7BGP7X.js → chunk-RDV2RHVH.js} +3 -3
- package/dist/{chunk-BZC24YXS.js → chunk-RKWJMA2B.js} +2 -2
- package/dist/{chunk-ZQZDGIN4.js → chunk-TAU45SJK.js} +2 -2
- package/dist/{chunk-K7FP2VOU.js → chunk-U6D7LUCR.js} +2 -2
- package/dist/{chunk-64V65GZM.js → chunk-UKLNKY7Q.js} +3 -3
- package/dist/{chunk-HY5O4B6O.cjs → chunk-VA43X5N4.cjs} +3 -3
- package/dist/{chunk-HY5O4B6O.cjs.map → chunk-VA43X5N4.cjs.map} +1 -1
- package/dist/{chunk-7FCNOKOR.js → chunk-VKVDMH7X.js} +2 -1
- package/dist/{chunk-KFJP2HYL.js → chunk-XEUBMLAS.js} +2 -2
- package/dist/{chunk-QY627PK3.cjs → chunk-Y7XHHV55.cjs} +28 -27
- package/dist/chunk-Y7XHHV55.cjs.map +1 -0
- package/dist/{chunk-7MIA3IFO.js → chunk-YA6UGARL.js} +2 -2
- package/dist/{chunk-VUSPHKQ6.js → chunk-ZE77KLKN.js} +2 -2
- package/dist/chunks-PR2GRNLX.js +10 -0
- package/dist/cli.js +34 -34
- package/dist/{formula-I7GNHDP4.js → formula-2MTBKZKO.js} +4 -4
- package/dist/{formula-LDXFM42U.cjs → formula-CY2HF27M.cjs} +9 -9
- package/dist/{formula-LDXFM42U.cjs.map → formula-CY2HF27M.cjs.map} +1 -1
- package/dist/{formula-L4ISZCZ7.js → formula-LGLSIYDI.js} +3 -3
- package/dist/{image-ocr-I7IVLLPD.js → image-ocr-BKRQVMW6.js} +9 -9
- package/dist/{image-ocr-NCKZ4EOH.cjs → image-ocr-HJM5IJKU.cjs} +15 -15
- package/dist/{image-ocr-NCKZ4EOH.cjs.map → image-ocr-HJM5IJKU.cjs.map} +1 -1
- package/dist/{image-ocr-BSAPJIFP.js → image-ocr-HP65O2CC.js} +6 -6
- package/dist/index.cjs +653 -577
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +83 -7
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +28 -28
- package/dist/{model-bundle-M3GRBX2A.js → model-bundle-M7YMF4L4.js} +5 -5
- package/dist/{models-5RXMJK6N.js → models-AMPRHBYB.js} +5 -5
- package/dist/{parse-worker-v2-72KKZMDO.js → parse-worker-v2-NMYEMVYX.js} +14 -14
- package/dist/{parser-XQL37S4F.cjs → parser-J6M4WG3I.cjs} +136 -136
- package/dist/{parser-XQL37S4F.cjs.map → parser-J6M4WG3I.cjs.map} +1 -1
- package/dist/{parser-AHSXHMAF.js → parser-LX5MOE6Q.js} +8 -8
- package/dist/{parser-QLNX2EFP.js → parser-M45SFXWF.js} +22 -22
- package/dist/pdf-ocr-4YVV5PT4.cjs +19 -0
- package/dist/{pdf-ocr-V42HOZKB.cjs.map → pdf-ocr-4YVV5PT4.cjs.map} +1 -1
- package/dist/pdf-ocr-D73YYQJ5.js +18 -0
- package/dist/pdf-ocr-SLWZO4D2.js +22 -0
- package/dist/{profile-io-FTGHBFAH.js → profile-io-CUMSC3TD.js} +3 -3
- package/dist/{rasterize-346O4XV4.js → rasterize-W6NY4ADH.js} +3 -3
- package/dist/{redact-doc-O6UVSWKP.js → redact-doc-7HVCZT3C.js} +25 -25
- package/dist/{render-CUR3VCK5.js → render-FPMJX4CU.js} +9 -9
- package/dist/seal-YTRVR373.js +10 -0
- package/dist/{setup-6EA7CJZU.js → setup-UKIYOUT6.js} +3 -3
- package/dist/visual-DG5EVBZD.js +20 -0
- package/dist/{watch-EQRSWNAQ.js → watch-YHKMAVJ6.js} +16 -16
- package/package.json +1 -1
- package/dist/chunk-NT4LPP2I.js.map +0 -1
- package/dist/chunk-PQW2RPZZ.js.map +0 -1
- package/dist/chunk-QY627PK3.cjs.map +0 -1
- package/dist/chunks-YV22WKEN.js +0 -10
- package/dist/pdf-ocr-CR4W75XF.js +0 -22
- package/dist/pdf-ocr-FL32Z4MB.js +0 -18
- package/dist/pdf-ocr-V42HOZKB.cjs +0 -19
- package/dist/seal-QUUK6RBL.js +0 -10
- package/dist/visual-EMOEYBC4.js +0 -20
- /package/dist/{-PLOEMNCA.js.map → -FLEBKE6V.js.map} +0 -0
- /package/dist/{chunk-6LJ22335.js.map → chunk-2S37CQUJ.js.map} +0 -0
- /package/dist/{chunk-BMQATDUY.js.map → chunk-75J4Y5ZQ.js.map} +0 -0
- /package/dist/{chunk-7TLZ56ZK.js.map → chunk-7MTKOSAF.js.map} +0 -0
- /package/dist/{chunk-SQSGBKCL.js.map → chunk-C3RR6Z3M.js.map} +0 -0
- /package/dist/{chunk-6Z4NAN36.js.map → chunk-CA742RMF.js.map} +0 -0
- /package/dist/{chunk-M5SPGZKY.js.map → chunk-DACTHSPR.js.map} +0 -0
- /package/dist/{chunk-64MCJ5GC.js.map → chunk-GNIOEZDG.js.map} +0 -0
- /package/dist/{chunk-3BJW5KXR.js.map → chunk-GPIMKPEI.js.map} +0 -0
- /package/dist/{chunk-G4DVIZTZ.js.map → chunk-J25WF6DP.js.map} +0 -0
- /package/dist/{chunk-H6EXISSP.js.map → chunk-JA4ZWCYL.js.map} +0 -0
- /package/dist/{chunk-LZVOL2H2.js.map → chunk-JLG7KK4M.js.map} +0 -0
- /package/dist/{chunk-PY72S2AG.js.map → chunk-JUA7IACQ.js.map} +0 -0
- /package/dist/{chunk-GYQGKVTQ.js.map → chunk-L4NFUEWJ.js.map} +0 -0
- /package/dist/{chunk-EL7BGP7X.js.map → chunk-RDV2RHVH.js.map} +0 -0
- /package/dist/{chunk-BZC24YXS.js.map → chunk-RKWJMA2B.js.map} +0 -0
- /package/dist/{chunk-ZQZDGIN4.js.map → chunk-TAU45SJK.js.map} +0 -0
- /package/dist/{chunk-K7FP2VOU.js.map → chunk-U6D7LUCR.js.map} +0 -0
- /package/dist/{chunk-64V65GZM.js.map → chunk-UKLNKY7Q.js.map} +0 -0
- /package/dist/{chunk-7FCNOKOR.js.map → chunk-VKVDMH7X.js.map} +0 -0
- /package/dist/{chunk-KFJP2HYL.js.map → chunk-XEUBMLAS.js.map} +0 -0
- /package/dist/{chunk-7MIA3IFO.js.map → chunk-YA6UGARL.js.map} +0 -0
- /package/dist/{chunk-VUSPHKQ6.js.map → chunk-ZE77KLKN.js.map} +0 -0
- /package/dist/{chunks-YV22WKEN.js.map → chunks-PR2GRNLX.js.map} +0 -0
- /package/dist/{formula-I7GNHDP4.js.map → formula-2MTBKZKO.js.map} +0 -0
- /package/dist/{formula-L4ISZCZ7.js.map → formula-LGLSIYDI.js.map} +0 -0
- /package/dist/{image-ocr-I7IVLLPD.js.map → image-ocr-BKRQVMW6.js.map} +0 -0
- /package/dist/{image-ocr-BSAPJIFP.js.map → image-ocr-HP65O2CC.js.map} +0 -0
- /package/dist/{model-bundle-M3GRBX2A.js.map → model-bundle-M7YMF4L4.js.map} +0 -0
- /package/dist/{models-5RXMJK6N.js.map → models-AMPRHBYB.js.map} +0 -0
- /package/dist/{parse-worker-v2-72KKZMDO.js.map → parse-worker-v2-NMYEMVYX.js.map} +0 -0
- /package/dist/{parser-AHSXHMAF.js.map → parser-LX5MOE6Q.js.map} +0 -0
- /package/dist/{parser-QLNX2EFP.js.map → parser-M45SFXWF.js.map} +0 -0
- /package/dist/{pdf-ocr-CR4W75XF.js.map → pdf-ocr-D73YYQJ5.js.map} +0 -0
- /package/dist/{pdf-ocr-FL32Z4MB.js.map → pdf-ocr-SLWZO4D2.js.map} +0 -0
- /package/dist/{profile-io-FTGHBFAH.js.map → profile-io-CUMSC3TD.js.map} +0 -0
- /package/dist/{rasterize-346O4XV4.js.map → rasterize-W6NY4ADH.js.map} +0 -0
- /package/dist/{redact-doc-O6UVSWKP.js.map → redact-doc-7HVCZT3C.js.map} +0 -0
- /package/dist/{render-CUR3VCK5.js.map → render-FPMJX4CU.js.map} +0 -0
- /package/dist/{seal-QUUK6RBL.js.map → seal-YTRVR373.js.map} +0 -0
- /package/dist/{setup-6EA7CJZU.js.map → setup-UKIYOUT6.js.map} +0 -0
- /package/dist/{visual-EMOEYBC4.js.map → visual-DG5EVBZD.js.map} +0 -0
- /package/dist/{watch-EQRSWNAQ.js.map → watch-YHKMAVJ6.js.map} +0 -0
package/README.md
CHANGED
|
@@ -117,10 +117,11 @@ await writeFile("보고서.hwpx", Buffer.from(hwpx))
|
|
|
117
117
|
|
|
118
118
|
## 최근 업데이트
|
|
119
119
|
|
|
120
|
-
최신 배포: **[4.21.
|
|
120
|
+
최신 배포: **[4.21.23](https://github.com/chrisryugj/kordoc/releases/tag/v4.21.23)** · 2026-10-11
|
|
121
121
|
|
|
122
122
|
| 버전 | 주요 변경 |
|
|
123
123
|
| --- | --- |
|
|
124
|
+
| 4.21.23 | HWP·HWPX 삽입 그림 속 글 OCR — `ocr: true` 일 때 그림 블록 뒤에 그림 속 글(#143, 기본 산출 불변) |
|
|
124
125
|
| 4.21.22 | PDF 양쪽 정렬 영문 참고문헌 줄을 열로 읽어 낱말이 뒤섞이던 것 고침 (web052 읽기 순서 → 1, score 커버리지 2문서 → 1) |
|
|
125
126
|
| 4.21.21 | PDF 쪽 테두리 틀 안 바닥글 걷기 · 첨부 이름표("<붙임2>"·"<별지 서식 제3호>")·강의 번호를 머리말로 지우던 것 고침 (PDF 글 정확도 99.64 → 99.67%, 어절 F1 99.00 → 99.02%) |
|
|
126
127
|
| 4.21.20 | PDF 괘선 없는 표 칸의 어절 가운데 꺾임을 붙여 씀("남⏎편이") · 채우기·패치 서식 보존(바뀐 문단만 줄 배치 캐시 삭제·강조 표지·균등 띄어쓰기·라벨 칸 방향) (PDF 어절 F1 98.987 → 98.998%) |
|
|
@@ -54,25 +54,10 @@ import {
|
|
|
54
54
|
unknownFontWarnings,
|
|
55
55
|
usesGaejosikMunche,
|
|
56
56
|
validateHwpx
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import {
|
|
59
|
-
blocksToPages
|
|
60
|
-
} from "./chunk-LZVOL2H2.js";
|
|
61
|
-
import {
|
|
62
|
-
applySplices,
|
|
63
|
-
buildParagraphSplices,
|
|
64
|
-
buildRangeSplices,
|
|
65
|
-
placeSealHwpx,
|
|
66
|
-
scanSectionXml
|
|
67
|
-
} from "./chunk-H6EXISSP.js";
|
|
68
|
-
import {
|
|
69
|
-
DEFAULT_REDACT_RULES,
|
|
70
|
-
redactMarkdown,
|
|
71
|
-
redactText
|
|
72
|
-
} from "./chunk-3WSNLH4B.js";
|
|
57
|
+
} from "./chunk-4F6OVO2A.js";
|
|
73
58
|
import {
|
|
74
59
|
blocksToChunks
|
|
75
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-7MTKOSAF.js";
|
|
76
61
|
import {
|
|
77
62
|
SPACE_EM_FIXED,
|
|
78
63
|
SPACE_EM_FONT,
|
|
@@ -97,20 +82,35 @@ import {
|
|
|
97
82
|
renderSceneToHtml,
|
|
98
83
|
simulateWrap,
|
|
99
84
|
simulateWrapKeepWord
|
|
100
|
-
} from "./chunk-
|
|
101
|
-
import "./chunk-
|
|
102
|
-
import
|
|
85
|
+
} from "./chunk-2S37CQUJ.js";
|
|
86
|
+
import "./chunk-RKWJMA2B.js";
|
|
87
|
+
import {
|
|
88
|
+
blocksToPages
|
|
89
|
+
} from "./chunk-JLG7KK4M.js";
|
|
90
|
+
import "./chunk-VKVDMH7X.js";
|
|
103
91
|
import "./chunk-VQFA55IC.js";
|
|
104
|
-
import "./chunk-
|
|
92
|
+
import "./chunk-YA6UGARL.js";
|
|
105
93
|
import {
|
|
106
94
|
blocksToMarkdown,
|
|
107
95
|
flattenLayoutTables,
|
|
108
96
|
hasStructuredCellContent
|
|
109
|
-
} from "./chunk-
|
|
110
|
-
import
|
|
97
|
+
} from "./chunk-GPIMKPEI.js";
|
|
98
|
+
import {
|
|
99
|
+
applySplices,
|
|
100
|
+
buildParagraphSplices,
|
|
101
|
+
buildRangeSplices,
|
|
102
|
+
placeSealHwpx,
|
|
103
|
+
scanSectionXml
|
|
104
|
+
} from "./chunk-JA4ZWCYL.js";
|
|
105
|
+
import "./chunk-U6D7LUCR.js";
|
|
111
106
|
import {
|
|
112
107
|
VERSION
|
|
113
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-TAU45SJK.js";
|
|
109
|
+
import {
|
|
110
|
+
DEFAULT_REDACT_RULES,
|
|
111
|
+
redactMarkdown,
|
|
112
|
+
redactText
|
|
113
|
+
} from "./chunk-3WSNLH4B.js";
|
|
114
114
|
export {
|
|
115
115
|
AGENCY_COMMON_NAME,
|
|
116
116
|
BUILTIN_TEMPLATES,
|
|
@@ -204,4 +204,4 @@ export {
|
|
|
204
204
|
usesGaejosikMunche,
|
|
205
205
|
validateHwpx
|
|
206
206
|
};
|
|
207
|
-
//# sourceMappingURL=-
|
|
207
|
+
//# sourceMappingURL=-FLEBKE6V.js.map
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
loadSharp,
|
|
4
|
+
rasterizePageSvg
|
|
5
|
+
} from "./chunk-RKWJMA2B.js";
|
|
2
6
|
import {
|
|
3
7
|
inlineImagesIntoMarkdown
|
|
4
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-VKVDMH7X.js";
|
|
9
|
+
import {
|
|
10
|
+
parsePageRange
|
|
11
|
+
} from "./chunk-VQFA55IC.js";
|
|
5
12
|
import {
|
|
6
13
|
CELL_EDGES,
|
|
7
14
|
HEADING_RATIO_H1,
|
|
@@ -9,20 +16,7 @@ import {
|
|
|
9
16
|
HEADING_RATIO_H3,
|
|
10
17
|
tidyScriptTags,
|
|
11
18
|
unframeLayoutTables
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
parsePageRange
|
|
15
|
-
} from "./chunk-VQFA55IC.js";
|
|
16
|
-
import {
|
|
17
|
-
DEFAULT_CHAR,
|
|
18
|
-
DEFAULT_PARA_GEOM,
|
|
19
|
-
MAX_DECOMPRESS_SIZE,
|
|
20
|
-
MAX_ZIP_ENTRIES,
|
|
21
|
-
createXmlParser,
|
|
22
|
-
findChildByLocalName,
|
|
23
|
-
hwpFaceToCssStack,
|
|
24
|
-
parseRenderStyles
|
|
25
|
-
} from "./chunk-K7FP2VOU.js";
|
|
19
|
+
} from "./chunk-YA6UGARL.js";
|
|
26
20
|
import {
|
|
27
21
|
MAX_COLS,
|
|
28
22
|
MAX_ROWS,
|
|
@@ -33,18 +27,24 @@ import {
|
|
|
33
27
|
flattenLayoutTables,
|
|
34
28
|
mapPuaText,
|
|
35
29
|
markNonLayoutTable
|
|
36
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GPIMKPEI.js";
|
|
37
31
|
import {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
DEFAULT_CHAR,
|
|
33
|
+
DEFAULT_PARA_GEOM,
|
|
34
|
+
MAX_DECOMPRESS_SIZE,
|
|
35
|
+
MAX_ZIP_ENTRIES,
|
|
36
|
+
createXmlParser,
|
|
37
|
+
findChildByLocalName,
|
|
38
|
+
hwpFaceToCssStack,
|
|
39
|
+
parseRenderStyles
|
|
40
|
+
} from "./chunk-U6D7LUCR.js";
|
|
41
41
|
import {
|
|
42
42
|
KordocError,
|
|
43
43
|
escapeHtml,
|
|
44
44
|
precheckZipSize,
|
|
45
45
|
sanitizeHref,
|
|
46
46
|
toArrayBuffer
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-TAU45SJK.js";
|
|
48
48
|
|
|
49
49
|
// src/render/svg-render.ts
|
|
50
50
|
import JSZip from "jszip";
|
|
@@ -7804,4 +7804,4 @@ export {
|
|
|
7804
7804
|
cropRect,
|
|
7805
7805
|
extractRenderedRegions
|
|
7806
7806
|
};
|
|
7807
|
-
//# sourceMappingURL=chunk-
|
|
7807
|
+
//# sourceMappingURL=chunk-2S37CQUJ.js.map
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
blocksToPages
|
|
4
|
-
} from "./chunk-LZVOL2H2.js";
|
|
5
|
-
import {
|
|
6
|
-
allLinesegRemovalSplices,
|
|
7
|
-
applySplices,
|
|
8
|
-
buildParagraphSplices,
|
|
9
|
-
buildRangeSplices,
|
|
10
|
-
changedLinesegRemovalSplices,
|
|
11
|
-
decodeXmlEntities,
|
|
12
|
-
escapeXmlText,
|
|
13
|
-
findElementEnd,
|
|
14
|
-
markerRunSplices,
|
|
15
|
-
paraTText,
|
|
16
|
-
paraTextPureT,
|
|
17
|
-
patchZipEntries,
|
|
18
|
-
readZipEntries,
|
|
19
|
-
scanSectionXml
|
|
20
|
-
} from "./chunk-H6EXISSP.js";
|
|
21
2
|
import {
|
|
22
3
|
CONVERT_MAP,
|
|
23
4
|
FLAG_COMPRESSED,
|
|
@@ -68,10 +49,17 @@ import {
|
|
|
68
49
|
romanNumeral,
|
|
69
50
|
simulateWrap,
|
|
70
51
|
takeTocLeaders
|
|
71
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-2S37CQUJ.js";
|
|
72
53
|
import {
|
|
54
|
+
blocksToPages
|
|
55
|
+
} from "./chunk-JLG7KK4M.js";
|
|
56
|
+
import {
|
|
57
|
+
bmpToPng,
|
|
73
58
|
inlineImagesIntoMarkdown
|
|
74
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-VKVDMH7X.js";
|
|
60
|
+
import {
|
|
61
|
+
parsePageRange
|
|
62
|
+
} from "./chunk-VQFA55IC.js";
|
|
75
63
|
import {
|
|
76
64
|
CELL_EDGES,
|
|
77
65
|
HEADING_RATIO_H1,
|
|
@@ -83,10 +71,38 @@ import {
|
|
|
83
71
|
tidyScriptTags,
|
|
84
72
|
unframeLayoutTables,
|
|
85
73
|
wrapScript
|
|
86
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-YA6UGARL.js";
|
|
87
75
|
import {
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
MAX_COLS,
|
|
77
|
+
MAX_ROWS,
|
|
78
|
+
MAX_TABLE_CELLS,
|
|
79
|
+
blocksToMarkdown,
|
|
80
|
+
buildTable,
|
|
81
|
+
convertTableToText,
|
|
82
|
+
escapeGfm,
|
|
83
|
+
escapeHtmlCellText,
|
|
84
|
+
escapeLiteralDollar,
|
|
85
|
+
flattenLayoutTables,
|
|
86
|
+
hasStructuredCellContent,
|
|
87
|
+
mapPuaText,
|
|
88
|
+
noteSuffix
|
|
89
|
+
} from "./chunk-GPIMKPEI.js";
|
|
90
|
+
import {
|
|
91
|
+
allLinesegRemovalSplices,
|
|
92
|
+
applySplices,
|
|
93
|
+
buildParagraphSplices,
|
|
94
|
+
buildRangeSplices,
|
|
95
|
+
changedLinesegRemovalSplices,
|
|
96
|
+
decodeXmlEntities,
|
|
97
|
+
escapeXmlText,
|
|
98
|
+
findElementEnd,
|
|
99
|
+
markerRunSplices,
|
|
100
|
+
paraTText,
|
|
101
|
+
paraTextPureT,
|
|
102
|
+
patchZipEntries,
|
|
103
|
+
readZipEntries,
|
|
104
|
+
scanSectionXml
|
|
105
|
+
} from "./chunk-JA4ZWCYL.js";
|
|
90
106
|
import {
|
|
91
107
|
MAX_DECOMPRESS_SIZE,
|
|
92
108
|
MAX_XML_DEPTH,
|
|
@@ -103,22 +119,7 @@ import {
|
|
|
103
119
|
localName,
|
|
104
120
|
rawTextContent,
|
|
105
121
|
readZipEntry
|
|
106
|
-
} from "./chunk-
|
|
107
|
-
import {
|
|
108
|
-
MAX_COLS,
|
|
109
|
-
MAX_ROWS,
|
|
110
|
-
MAX_TABLE_CELLS,
|
|
111
|
-
blocksToMarkdown,
|
|
112
|
-
buildTable,
|
|
113
|
-
convertTableToText,
|
|
114
|
-
escapeGfm,
|
|
115
|
-
escapeHtmlCellText,
|
|
116
|
-
escapeLiteralDollar,
|
|
117
|
-
flattenLayoutTables,
|
|
118
|
-
hasStructuredCellContent,
|
|
119
|
-
mapPuaText,
|
|
120
|
-
noteSuffix
|
|
121
|
-
} from "./chunk-3BJW5KXR.js";
|
|
122
|
+
} from "./chunk-U6D7LUCR.js";
|
|
122
123
|
import {
|
|
123
124
|
KordocError,
|
|
124
125
|
classifyError,
|
|
@@ -134,7 +135,7 @@ import {
|
|
|
134
135
|
toArrayBuffer,
|
|
135
136
|
unescapeHtml,
|
|
136
137
|
unzipLimitBytes
|
|
137
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-TAU45SJK.js";
|
|
138
139
|
|
|
139
140
|
// src/table/visual.ts
|
|
140
141
|
import { readFile as readFile2 } from "fs/promises";
|
|
@@ -19952,6 +19953,66 @@ function collectAllTables(scan) {
|
|
|
19952
19953
|
return out;
|
|
19953
19954
|
}
|
|
19954
19955
|
|
|
19956
|
+
// src/ocr/embedded-image-ocr.ts
|
|
19957
|
+
var MIN_SIDE = 24;
|
|
19958
|
+
async function ocrEmbeddedImages(blocks, options, warnings) {
|
|
19959
|
+
const ocr = options?.ocr;
|
|
19960
|
+
if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
|
|
19961
|
+
const { parseImageDocument } = await import("./image-ocr-BKRQVMW6.js");
|
|
19962
|
+
let inserted = false, unreadable = 0;
|
|
19963
|
+
let failed = null;
|
|
19964
|
+
const walk = async (list, depth) => {
|
|
19965
|
+
if (depth > 64) return;
|
|
19966
|
+
for (let i = 0; i < list.length; i++) {
|
|
19967
|
+
const b = list[i];
|
|
19968
|
+
if (b.children) await walk(b.children, depth + 1);
|
|
19969
|
+
if (b.table) {
|
|
19970
|
+
for (const row of b.table.cells) for (const cell2 of row) if (cell2.blocks) await walk(cell2.blocks, depth + 1);
|
|
19971
|
+
}
|
|
19972
|
+
if (b.type !== "image" || !b.imageData || failed) continue;
|
|
19973
|
+
const bytes = ocrBytes(b.imageData);
|
|
19974
|
+
if (!bytes) {
|
|
19975
|
+
unreadable++;
|
|
19976
|
+
continue;
|
|
19977
|
+
}
|
|
19978
|
+
if (await tooSmall(bytes)) continue;
|
|
19979
|
+
let found;
|
|
19980
|
+
try {
|
|
19981
|
+
const buf = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength);
|
|
19982
|
+
found = (await parseImageDocument(buf, options)).blocks;
|
|
19983
|
+
} catch (err) {
|
|
19984
|
+
failed = err instanceof Error ? err.message : String(err);
|
|
19985
|
+
continue;
|
|
19986
|
+
}
|
|
19987
|
+
if (!found.length) continue;
|
|
19988
|
+
const placed = found.map((f) => ({ ...f, pageNumber: b.pageNumber, bbox: void 0 }));
|
|
19989
|
+
list.splice(i + 1, 0, ...placed);
|
|
19990
|
+
i += placed.length;
|
|
19991
|
+
inserted = true;
|
|
19992
|
+
}
|
|
19993
|
+
};
|
|
19994
|
+
await walk(blocks, 0);
|
|
19995
|
+
if (unreadable) warnings.push({ code: "SKIPPED_IMAGE", message: `${unreadable}\uAC1C \uADF8\uB9BC\uC740 OCR \uB85C \uC77D\uC744 \uC218 \uC5C6\uB294 \uD615\uC2DD(WMF\xB7EMF \uB4F1)\uC774\uB77C \uAC74\uB108\uB700` });
|
|
19996
|
+
if (failed) warnings.push({ code: "OCR_FAILED", message: `\uC0BD\uC785 \uADF8\uB9BC OCR \uC2E4\uD328 \u2014 \uADF8\uB9BC \uC18D \uAE00 \uC5C6\uC774 \uACC4\uC18D: ${failed}` });
|
|
19997
|
+
return inserted;
|
|
19998
|
+
}
|
|
19999
|
+
function ocrBytes(img) {
|
|
20000
|
+
const mime = img.mimeType.toLowerCase();
|
|
20001
|
+
if (mime.includes("wmf") || mime.includes("emf")) return null;
|
|
20002
|
+
if (mime.includes("bmp")) return bmpToPng(img.data);
|
|
20003
|
+
return img.data;
|
|
20004
|
+
}
|
|
20005
|
+
async function tooSmall(bytes) {
|
|
20006
|
+
try {
|
|
20007
|
+
const mod = await import("sharp");
|
|
20008
|
+
const sharp = typeof mod === "function" ? mod : mod.default;
|
|
20009
|
+
const { width, height } = await sharp(Buffer.from(bytes)).metadata();
|
|
20010
|
+
return !!width && !!height && (width < MIN_SIDE || height < MIN_SIDE);
|
|
20011
|
+
} catch {
|
|
20012
|
+
return false;
|
|
20013
|
+
}
|
|
20014
|
+
}
|
|
20015
|
+
|
|
19955
20016
|
// src/table/classifier.ts
|
|
19956
20017
|
var DIAGRAM_KEYWORDS = /조직도|비상\s*연락망|연락망|체계도|업무\s*체계도|기구표|배치도|흐름도|추진\s*체계/u;
|
|
19957
20018
|
var KEYWORD_GATE = 0.3;
|
|
@@ -31094,12 +31155,24 @@ async function dispatch(format2, buffer, opts) {
|
|
|
31094
31155
|
return { success: false, fileType: "unknown", error: "\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD615\uC2DD\uC785\uB2C8\uB2E4.", code: "UNSUPPORTED_FORMAT" };
|
|
31095
31156
|
}
|
|
31096
31157
|
}
|
|
31158
|
+
async function withEmbeddedImageOcr(blocks, markdown, warnings, images, options) {
|
|
31159
|
+
const list = [...warnings ?? []];
|
|
31160
|
+
if (!await ocrEmbeddedImages(blocks, options, list)) return { markdown, warnings: list.length ? list : void 0 };
|
|
31161
|
+
let md = blocksToMarkdown(blocks, { tableFormat: options?.tableFormat });
|
|
31162
|
+
if (options?.inlineImages && options.images !== false && images?.length) {
|
|
31163
|
+
try {
|
|
31164
|
+
md = inlineImagesIntoMarkdown(md, images, { compress: true });
|
|
31165
|
+
} catch {
|
|
31166
|
+
}
|
|
31167
|
+
}
|
|
31168
|
+
return { markdown: md, warnings: list.length ? list : void 0 };
|
|
31169
|
+
}
|
|
31097
31170
|
function scriptsOff(r, off) {
|
|
31098
31171
|
return off ? stripScriptTags(r) : r;
|
|
31099
31172
|
}
|
|
31100
31173
|
async function parseImage(buffer, options) {
|
|
31101
31174
|
try {
|
|
31102
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
31175
|
+
const { parseImageDocument } = await import("./image-ocr-BKRQVMW6.js");
|
|
31103
31176
|
const { blocks, warnings } = await parseImageDocument(buffer, options);
|
|
31104
31177
|
stripScriptTags({ blocks });
|
|
31105
31178
|
return {
|
|
@@ -31124,7 +31197,9 @@ async function parseHwp3(buffer, options) {
|
|
|
31124
31197
|
}
|
|
31125
31198
|
async function parseHwpx(buffer, options) {
|
|
31126
31199
|
try {
|
|
31127
|
-
const
|
|
31200
|
+
const doc = await parseHwpxDocument(buffer, options);
|
|
31201
|
+
const { blocks, metadata, outline, images } = doc;
|
|
31202
|
+
const { markdown, warnings } = await withEmbeddedImageOcr(blocks, doc.markdown, doc.warnings, void 0, options);
|
|
31128
31203
|
return scriptsOff({ success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount }, options?.scriptTags === false);
|
|
31129
31204
|
} catch (err) {
|
|
31130
31205
|
return { success: false, fileType: "hwpx", error: sanitizeError(err), code: classifyError(err) };
|
|
@@ -31151,7 +31226,8 @@ async function parseHwp(buffer, options) {
|
|
|
31151
31226
|
} catch {
|
|
31152
31227
|
}
|
|
31153
31228
|
}
|
|
31154
|
-
|
|
31229
|
+
const ocred = await withEmbeddedImageOcr(blocks, markdown, warnings, images, options);
|
|
31230
|
+
return scriptsOff({ success: true, fileType: "hwp", markdown: ocred.markdown, blocks, metadata, outline, warnings: ocred.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount }, options?.scriptTags === false);
|
|
31155
31231
|
} catch (err) {
|
|
31156
31232
|
return { success: false, fileType: "hwp", error: sanitizeError(err), code: classifyError(err) };
|
|
31157
31233
|
}
|
|
@@ -31159,7 +31235,7 @@ async function parseHwp(buffer, options) {
|
|
|
31159
31235
|
async function parsePdf(buffer, options) {
|
|
31160
31236
|
let parsePdfDocument;
|
|
31161
31237
|
try {
|
|
31162
|
-
const mod = await import("./parser-
|
|
31238
|
+
const mod = await import("./parser-M45SFXWF.js");
|
|
31163
31239
|
parsePdfDocument = mod.parsePdfDocument;
|
|
31164
31240
|
} catch {
|
|
31165
31241
|
return {
|
|
@@ -31389,4 +31465,4 @@ export {
|
|
|
31389
31465
|
parseHwpml,
|
|
31390
31466
|
fillForm
|
|
31391
31467
|
};
|
|
31392
|
-
//# sourceMappingURL=chunk-
|
|
31468
|
+
//# sourceMappingURL=chunk-4F6OVO2A.js.map
|