kordoc 4.24.47 → 4.24.49
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/NOTICE +21 -0
- package/README.md +4 -4
- package/dist/{-PWMZE4CC.js → -22V6D2US.js} +42 -42
- package/dist/{chunk-RQ4XTX4J.cjs → chunk-2UWWWM4Q.cjs} +98 -98
- package/dist/{chunk-RQ4XTX4J.cjs.map → chunk-2UWWWM4Q.cjs.map} +1 -1
- package/dist/{chunk-3CWVQNFL.cjs → chunk-367WLMPO.cjs} +59 -67
- package/dist/chunk-367WLMPO.cjs.map +1 -0
- package/dist/{chunk-Z5TDZDWU.js → chunk-4HJKBRZJ.js} +153 -50
- package/dist/chunk-4HJKBRZJ.js.map +1 -0
- package/dist/{chunk-GRQXAWNW.js → chunk-4MWUBTAE.js} +2 -2
- package/dist/{chunk-TN5ZK2WN.js → chunk-67GSFYG7.js} +2 -2
- package/dist/{chunk-TGLXN6VH.js → chunk-6BFWLS7E.js} +3 -3
- package/dist/{chunk-X7RBVVDC.cjs → chunk-6NZ32OTX.cjs} +9 -3
- package/dist/chunk-6NZ32OTX.cjs.map +1 -0
- package/dist/{chunk-Q3UCWUEV.js → chunk-7KKL3PRK.js} +5 -13
- package/dist/chunk-7KKL3PRK.js.map +1 -0
- package/dist/{chunk-T5J4GW6B.js → chunk-AUAJVQQK.js} +2 -2
- package/dist/{chunk-KIVWAZKL.js → chunk-AXW2FMVR.js} +2 -2
- package/dist/{chunk-LEUAWTMU.js → chunk-CCQMSIZQ.js} +19 -19
- package/dist/{chunk-PM46GSMV.js → chunk-DA5AXURC.js} +194 -6
- package/dist/chunk-DA5AXURC.js.map +1 -0
- package/dist/{chunk-SUIH5LY7.js → chunk-DAAJO62F.js} +2 -2
- package/dist/{chunk-4MNRUPS5.js → chunk-EUJX7HTR.js} +53 -10
- package/dist/chunk-EUJX7HTR.js.map +1 -0
- package/dist/{chunk-56FEGA44.js → chunk-EYSXMDA7.js} +17 -17
- package/dist/{chunk-VKVDMH7X.js → chunk-FU6ZDWCI.js} +8 -2
- package/dist/chunk-FU6ZDWCI.js.map +1 -0
- package/dist/{chunk-KSE5HSU3.js → chunk-HETGOJ6V.js} +8 -5
- package/dist/chunk-HETGOJ6V.js.map +1 -0
- package/dist/{chunk-HFQFCAEJ.js → chunk-HW7WVYBF.js} +2 -2
- package/dist/{chunk-O2652KK3.cjs → chunk-IRAZCKQ6.cjs} +3 -3
- package/dist/{chunk-O2652KK3.cjs.map → chunk-IRAZCKQ6.cjs.map} +1 -1
- package/dist/{chunk-AB7MYMPZ.js → chunk-KB4ORA7M.js} +2 -2
- package/dist/{chunk-57BKTVR5.js → chunk-KXHUHGMC.js} +2 -2
- package/dist/{chunk-YLYSJSEP.js → chunk-L3JP55ZY.js} +2 -2
- package/dist/{chunk-2CBIY2OH.js → chunk-LCRSRVFJ.js} +2 -2
- package/dist/{chunk-2CBIY2OH.js.map → chunk-LCRSRVFJ.js.map} +1 -1
- package/dist/{chunk-IPXFIH5E.js → chunk-LFFARZYZ.js} +8 -5
- package/dist/chunk-LFFARZYZ.js.map +1 -0
- package/dist/{chunk-BO2IJGNZ.js → chunk-LOSCIAHY.js} +2 -2
- package/dist/{chunk-SQ5Q4Q3R.js → chunk-M5RQ2PNP.js} +6 -14
- package/dist/chunk-M5RQ2PNP.js.map +1 -0
- package/dist/{chunk-MOWJOFIH.js → chunk-MIJTZKWF.js} +2 -2
- package/dist/chunk-MLBX6KQM.js +153 -0
- package/dist/chunk-MLBX6KQM.js.map +1 -0
- package/dist/{chunk-HMD35PMD.js → chunk-OAETOHH3.js} +3 -3
- package/dist/{chunk-IWC6PTMT.js → chunk-PMGJQWSW.js} +2 -2
- package/dist/{chunk-LMHE4HDR.cjs → chunk-PVV6OY4M.cjs} +286 -98
- package/dist/chunk-PVV6OY4M.cjs.map +1 -0
- package/dist/{chunk-BKK2SMVM.cjs → chunk-PW7MQZI4.cjs} +2 -2
- package/dist/{chunk-BKK2SMVM.cjs.map → chunk-PW7MQZI4.cjs.map} +1 -1
- package/dist/{chunk-NYIJU4Q6.js → chunk-Q7FDPJUS.js} +10 -10
- package/dist/{chunk-FI7ULBC6.js → chunk-R2RLNUNK.js} +6 -6
- package/dist/{chunk-AO3YFJVW.js → chunk-RQLEGKEV.js} +2 -2
- package/dist/{chunk-OAKJNKAS.js → chunk-S54DZB2Z.js} +193 -5
- package/dist/chunk-S54DZB2Z.js.map +1 -0
- package/dist/{chunk-A67OXFXM.js → chunk-TAHS42ED.js} +54 -11
- package/dist/chunk-TAHS42ED.js.map +1 -0
- package/dist/{chunk-WAFJUSUF.cjs → chunk-TQOAPKLU.cjs} +11 -8
- package/dist/chunk-TQOAPKLU.cjs.map +1 -0
- package/dist/{chunk-UFY6XX4U.cjs → chunk-UBY2PLKR.cjs} +75 -32
- package/dist/chunk-UBY2PLKR.cjs.map +1 -0
- package/dist/{chunk-U556XJW6.js → chunk-UJELMNOU.js} +8 -2
- package/dist/chunk-UJELMNOU.js.map +1 -0
- package/dist/{chunk-FOTG4MMD.js → chunk-UU54HN5I.js} +6 -6
- package/dist/{chunk-BP5GDQBT.js → chunk-VMOUAWGD.js} +7 -7
- package/dist/{chunk-2VXVBB5Q.js → chunk-WLFZOBZR.js} +3 -3
- package/dist/chunk-Y4MFHEK4.cjs +156 -0
- package/dist/chunk-Y4MFHEK4.cjs.map +1 -0
- package/dist/{chunk-VL43TUO6.js → chunk-Y6QW3FJQ.js} +2 -2
- package/dist/chunk-ZF24SO45.js +154 -0
- package/dist/chunk-ZF24SO45.js.map +1 -0
- package/dist/chunks-Q7242OJE.js +11 -0
- package/dist/cli.js +74 -53
- package/dist/cli.js.map +1 -1
- package/dist/{formula-W5MTLANP.js → formula-BYEDWWZU.js} +4 -4
- package/dist/{formula-2BQBGPM2.js → formula-FQLMMBDP.js} +3 -3
- package/dist/{formula-V6CNOC4G.cjs → formula-QJEOIVKR.cjs} +9 -9
- package/dist/{formula-V6CNOC4G.cjs.map → formula-QJEOIVKR.cjs.map} +1 -1
- package/dist/generator-FTM6GOGB.cjs +11 -0
- package/dist/{generator-U2BRFTJ4.cjs.map → generator-FTM6GOGB.cjs.map} +1 -1
- package/dist/generator-Q3L7RNUY.js +17 -0
- package/dist/generator-SU73HZHR.js +10 -0
- package/dist/{image-ocr-COBRSG6O.js → image-ocr-7Y3FCGRR.js} +12 -10
- package/dist/image-ocr-7Y3FCGRR.js.map +1 -0
- package/dist/{image-ocr-2WSZULNO.js → image-ocr-VIGZE4YL.js} +9 -7
- package/dist/image-ocr-VIGZE4YL.js.map +1 -0
- package/dist/{image-ocr-MVOSHIY5.cjs → image-ocr-WRILL3WO.cjs} +29 -27
- package/dist/image-ocr-WRILL3WO.cjs.map +1 -0
- package/dist/index.cjs +1645 -1542
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -5
- package/dist/index.d.ts +18 -5
- package/dist/index.js +231 -128
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +42 -43
- package/dist/mcp.js.map +1 -1
- package/dist/memo-T5ZQEXEA.js +17 -0
- package/dist/{model-bundle-LFLRW2SI.js → model-bundle-UJRQPYUU.js} +5 -5
- package/dist/{models-UGOWUUAL.js → models-64YLAWTI.js} +5 -5
- package/dist/{parse-worker-v2-LCCTZWPT.js → parse-worker-v2-QWQZKFQO.js} +26 -24
- package/dist/parse-worker-v2-QWQZKFQO.js.map +1 -0
- package/dist/{parser-JAL2OOOL.js → parser-JPWANPLM.js} +428 -42
- package/dist/parser-JPWANPLM.js.map +1 -0
- package/dist/{parser-RE52HQXO.cjs → parser-RB6CBNAM.cjs} +720 -334
- package/dist/parser-RB6CBNAM.cjs.map +1 -0
- package/dist/{parser-J56FGU6P.js → parser-XFU3VRWM.js} +431 -45
- package/dist/parser-XFU3VRWM.js.map +1 -0
- package/dist/pdf-ocr-NOJHEH4M.cjs +42 -0
- package/dist/{pdf-ocr-5O336TCR.cjs.map → pdf-ocr-NOJHEH4M.cjs.map} +1 -1
- package/dist/{pdf-ocr-PQZZVFI5.js → pdf-ocr-XTZZEYKJ.js} +6 -6
- package/dist/{pdf-ocr-NQ3HAL77.js → pdf-ocr-ZV3KYIIE.js} +9 -9
- package/dist/{profile-io-K22CB2ZB.js → profile-io-FAJORRD2.js} +3 -3
- package/dist/{rasterize-A6B5K4QN.js → rasterize-4ZJUA2DZ.js} +3 -3
- package/dist/{redact-doc-TPXMML5Q.js → redact-doc-JPNROEH6.js} +30 -30
- package/dist/{render-ROFIMWW5.js → render-D4WBOBKI.js} +13 -13
- package/dist/{rewrite-fallback-WG7Z3LR3.js → rewrite-fallback-OF3QI6CX.js} +14 -14
- package/dist/seal-DQWEHIAM.js +16 -0
- package/dist/{setup-J5SHDFIE.js → setup-YC25YCQB.js} +3 -3
- package/dist/to-hwpx-D7OMPDUQ.js +21 -0
- package/dist/to-hwpx-LUA6F5RR.cjs +16 -0
- package/dist/{to-hwpx-RWDQB3T2.cjs.map → to-hwpx-LUA6F5RR.cjs.map} +1 -1
- package/dist/{to-hwpx-X7JE6YJB.js → to-hwpx-ZWN64NCQ.js} +5 -5
- package/dist/visual-SW7NPY6K.js +37 -0
- package/dist/{watch-WZBW6UE7.js → watch-ZU576VSR.js} +24 -24
- package/package.json +3 -2
- package/dist/chunk-3CWVQNFL.cjs.map +0 -1
- package/dist/chunk-4MNRUPS5.js.map +0 -1
- package/dist/chunk-A67OXFXM.js.map +0 -1
- package/dist/chunk-AYM7XTI2.js +0 -31
- package/dist/chunk-AYM7XTI2.js.map +0 -1
- package/dist/chunk-CQ33HCSU.js +0 -32
- package/dist/chunk-CQ33HCSU.js.map +0 -1
- package/dist/chunk-IPXFIH5E.js.map +0 -1
- package/dist/chunk-KSE5HSU3.js.map +0 -1
- package/dist/chunk-LMHE4HDR.cjs.map +0 -1
- package/dist/chunk-OAKJNKAS.js.map +0 -1
- package/dist/chunk-PM46GSMV.js.map +0 -1
- package/dist/chunk-Q3UCWUEV.js.map +0 -1
- package/dist/chunk-SQ5Q4Q3R.js.map +0 -1
- package/dist/chunk-U556XJW6.js.map +0 -1
- package/dist/chunk-UFY6XX4U.cjs.map +0 -1
- package/dist/chunk-VKVDMH7X.js.map +0 -1
- package/dist/chunk-WAFJUSUF.cjs.map +0 -1
- package/dist/chunk-WPLAEJU5.cjs +0 -31
- package/dist/chunk-WPLAEJU5.cjs.map +0 -1
- package/dist/chunk-X7RBVVDC.cjs.map +0 -1
- package/dist/chunk-Z5TDZDWU.js.map +0 -1
- package/dist/chunks-SHXTE5HM.js +0 -11
- package/dist/generator-E4VQKPRP.js +0 -10
- package/dist/generator-MBR4V3JQ.js +0 -17
- package/dist/generator-U2BRFTJ4.cjs +0 -11
- package/dist/hancom-7SU4XBXJ.js +0 -84
- package/dist/hancom-7SU4XBXJ.js.map +0 -1
- package/dist/hancom-MP7D7HWW.cjs +0 -85
- package/dist/hancom-MP7D7HWW.cjs.map +0 -1
- package/dist/hancom-RNJWH63M.js +0 -85
- package/dist/hancom-RNJWH63M.js.map +0 -1
- package/dist/image-ocr-2WSZULNO.js.map +0 -1
- package/dist/image-ocr-COBRSG6O.js.map +0 -1
- package/dist/image-ocr-MVOSHIY5.cjs.map +0 -1
- package/dist/memo-QJ5RKTBN.js +0 -17
- package/dist/parse-worker-v2-LCCTZWPT.js.map +0 -1
- package/dist/parser-J56FGU6P.js.map +0 -1
- package/dist/parser-JAL2OOOL.js.map +0 -1
- package/dist/parser-RE52HQXO.cjs.map +0 -1
- package/dist/pdf-ocr-5O336TCR.cjs +0 -42
- package/dist/seal-35U76WY2.js +0 -16
- package/dist/to-hwpx-RWDQB3T2.cjs +0 -16
- package/dist/to-hwpx-XQULU2I7.js +0 -21
- package/dist/visual-4HRP2VIH.js +0 -37
- /package/dist/{-PWMZE4CC.js.map → -22V6D2US.js.map} +0 -0
- /package/dist/{chunk-GRQXAWNW.js.map → chunk-4MWUBTAE.js.map} +0 -0
- /package/dist/{chunk-TN5ZK2WN.js.map → chunk-67GSFYG7.js.map} +0 -0
- /package/dist/{chunk-TGLXN6VH.js.map → chunk-6BFWLS7E.js.map} +0 -0
- /package/dist/{chunk-T5J4GW6B.js.map → chunk-AUAJVQQK.js.map} +0 -0
- /package/dist/{chunk-KIVWAZKL.js.map → chunk-AXW2FMVR.js.map} +0 -0
- /package/dist/{chunk-LEUAWTMU.js.map → chunk-CCQMSIZQ.js.map} +0 -0
- /package/dist/{chunk-SUIH5LY7.js.map → chunk-DAAJO62F.js.map} +0 -0
- /package/dist/{chunk-56FEGA44.js.map → chunk-EYSXMDA7.js.map} +0 -0
- /package/dist/{chunk-HFQFCAEJ.js.map → chunk-HW7WVYBF.js.map} +0 -0
- /package/dist/{chunk-AB7MYMPZ.js.map → chunk-KB4ORA7M.js.map} +0 -0
- /package/dist/{chunk-57BKTVR5.js.map → chunk-KXHUHGMC.js.map} +0 -0
- /package/dist/{chunk-YLYSJSEP.js.map → chunk-L3JP55ZY.js.map} +0 -0
- /package/dist/{chunk-BO2IJGNZ.js.map → chunk-LOSCIAHY.js.map} +0 -0
- /package/dist/{chunk-MOWJOFIH.js.map → chunk-MIJTZKWF.js.map} +0 -0
- /package/dist/{chunk-HMD35PMD.js.map → chunk-OAETOHH3.js.map} +0 -0
- /package/dist/{chunk-IWC6PTMT.js.map → chunk-PMGJQWSW.js.map} +0 -0
- /package/dist/{chunk-NYIJU4Q6.js.map → chunk-Q7FDPJUS.js.map} +0 -0
- /package/dist/{chunk-FI7ULBC6.js.map → chunk-R2RLNUNK.js.map} +0 -0
- /package/dist/{chunk-AO3YFJVW.js.map → chunk-RQLEGKEV.js.map} +0 -0
- /package/dist/{chunk-FOTG4MMD.js.map → chunk-UU54HN5I.js.map} +0 -0
- /package/dist/{chunk-BP5GDQBT.js.map → chunk-VMOUAWGD.js.map} +0 -0
- /package/dist/{chunk-2VXVBB5Q.js.map → chunk-WLFZOBZR.js.map} +0 -0
- /package/dist/{chunk-VL43TUO6.js.map → chunk-Y6QW3FJQ.js.map} +0 -0
- /package/dist/{chunks-SHXTE5HM.js.map → chunks-Q7242OJE.js.map} +0 -0
- /package/dist/{formula-W5MTLANP.js.map → formula-BYEDWWZU.js.map} +0 -0
- /package/dist/{formula-2BQBGPM2.js.map → formula-FQLMMBDP.js.map} +0 -0
- /package/dist/{generator-E4VQKPRP.js.map → generator-Q3L7RNUY.js.map} +0 -0
- /package/dist/{generator-MBR4V3JQ.js.map → generator-SU73HZHR.js.map} +0 -0
- /package/dist/{memo-QJ5RKTBN.js.map → memo-T5ZQEXEA.js.map} +0 -0
- /package/dist/{model-bundle-LFLRW2SI.js.map → model-bundle-UJRQPYUU.js.map} +0 -0
- /package/dist/{models-UGOWUUAL.js.map → models-64YLAWTI.js.map} +0 -0
- /package/dist/{pdf-ocr-NQ3HAL77.js.map → pdf-ocr-XTZZEYKJ.js.map} +0 -0
- /package/dist/{pdf-ocr-PQZZVFI5.js.map → pdf-ocr-ZV3KYIIE.js.map} +0 -0
- /package/dist/{profile-io-K22CB2ZB.js.map → profile-io-FAJORRD2.js.map} +0 -0
- /package/dist/{rasterize-A6B5K4QN.js.map → rasterize-4ZJUA2DZ.js.map} +0 -0
- /package/dist/{redact-doc-TPXMML5Q.js.map → redact-doc-JPNROEH6.js.map} +0 -0
- /package/dist/{render-ROFIMWW5.js.map → render-D4WBOBKI.js.map} +0 -0
- /package/dist/{rewrite-fallback-WG7Z3LR3.js.map → rewrite-fallback-OF3QI6CX.js.map} +0 -0
- /package/dist/{seal-35U76WY2.js.map → seal-DQWEHIAM.js.map} +0 -0
- /package/dist/{setup-J5SHDFIE.js.map → setup-YC25YCQB.js.map} +0 -0
- /package/dist/{to-hwpx-X7JE6YJB.js.map → to-hwpx-D7OMPDUQ.js.map} +0 -0
- /package/dist/{to-hwpx-XQULU2I7.js.map → to-hwpx-ZWN64NCQ.js.map} +0 -0
- /package/dist/{visual-4HRP2VIH.js.map → visual-SW7NPY6K.js.map} +0 -0
- /package/dist/{watch-WZBW6UE7.js.map → watch-ZU576VSR.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,65 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
TAG_CHAR_SHAPE,
|
|
9
|
-
TAG_CTRL_HEADER,
|
|
10
|
-
TAG_DOC_CHAR_SHAPE,
|
|
11
|
-
TAG_DOC_PARA_SHAPE,
|
|
12
|
-
TAG_FACE_NAME,
|
|
13
|
-
TAG_ID_MAPPINGS,
|
|
14
|
-
TAG_LIST_HEADER,
|
|
15
|
-
TAG_PARA_HEADER,
|
|
16
|
-
TAG_PARA_LINE_SEG,
|
|
17
|
-
TAG_PARA_TEXT,
|
|
18
|
-
TAG_SHAPE_COMPONENT,
|
|
19
|
-
TAG_SHAPE_COMPONENT_PICTURE,
|
|
20
|
-
TAG_TABLE,
|
|
21
|
-
appendParaText,
|
|
22
|
-
blocksPlainText,
|
|
23
|
-
buildAddressedTable,
|
|
24
|
-
cellTextFromBlocks,
|
|
25
|
-
convertToHwpx,
|
|
26
|
-
createParaTextState,
|
|
27
|
-
decompressStream,
|
|
28
|
-
detectImageMime,
|
|
29
|
-
emitParagraphBlocks,
|
|
30
|
-
fileTimeText,
|
|
31
|
-
formatNumber,
|
|
32
|
-
hasRealStrike,
|
|
33
|
-
hasRealUnderline,
|
|
34
|
-
hwpEquationToLatex,
|
|
35
|
-
hwpToHwpx,
|
|
36
|
-
indexHwp5Tables,
|
|
37
|
-
isClickHereGuideText,
|
|
38
|
-
isExtendedOnlyCtrlChar,
|
|
39
|
-
locateMemoBlocks,
|
|
40
|
-
memosMarkdown,
|
|
41
|
-
openHwp5Container,
|
|
42
|
-
parseDocInfo,
|
|
43
|
-
parseFileHeader,
|
|
44
|
-
parseHwp5Document,
|
|
45
|
-
readHwp5BinData,
|
|
46
|
-
readHwp5DocInfoRecords,
|
|
47
|
-
readHwp5SectionRecords,
|
|
48
|
-
readHwp5SectionStreams,
|
|
49
|
-
readRecords,
|
|
50
|
-
resolveImageBlocks,
|
|
51
|
-
unfilledClickHereGuide
|
|
52
|
-
} from "./chunk-Q3UCWUEV.js";
|
|
53
|
-
import {
|
|
54
|
-
blocksToPages
|
|
55
|
-
} from "./chunk-AYM7XTI2.js";
|
|
56
|
-
import {
|
|
57
|
-
bmpToPng,
|
|
58
|
-
inlineImagesIntoMarkdown
|
|
59
|
-
} from "./chunk-U556XJW6.js";
|
|
60
|
-
import {
|
|
61
|
-
parsePageRange
|
|
62
|
-
} from "./chunk-V4BH5SRQ.js";
|
|
2
|
+
WEBP_OPTIONS,
|
|
3
|
+
blocksToPages,
|
|
4
|
+
loadSharp,
|
|
5
|
+
readImageQrCodes,
|
|
6
|
+
toBuffer
|
|
7
|
+
} from "./chunk-MLBX6KQM.js";
|
|
63
8
|
import {
|
|
64
9
|
detectFormat,
|
|
65
10
|
detectOle2Format,
|
|
@@ -69,9 +14,6 @@ import {
|
|
|
69
14
|
isPdfFile,
|
|
70
15
|
isZipFile
|
|
71
16
|
} from "./chunk-S6H3ZPYQ.js";
|
|
72
|
-
import {
|
|
73
|
-
parseLenientCfb
|
|
74
|
-
} from "./chunk-PDI54TF2.js";
|
|
75
17
|
import {
|
|
76
18
|
validateOcrOptions
|
|
77
19
|
} from "./chunk-TBGGAR7W.js";
|
|
@@ -229,7 +171,71 @@ import {
|
|
|
229
171
|
unescapeGfm,
|
|
230
172
|
unescapeGfmCell,
|
|
231
173
|
wordHunks
|
|
232
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-WLFZOBZR.js";
|
|
175
|
+
import {
|
|
176
|
+
FLAG_COMPRESSED,
|
|
177
|
+
FLAG_DISTRIBUTION,
|
|
178
|
+
FLAG_DRM,
|
|
179
|
+
FLAG_ENCRYPTED,
|
|
180
|
+
FLAG_TRACK_CHANGES,
|
|
181
|
+
INLINE_TABLE_MARK,
|
|
182
|
+
TAG_CHAR_SHAPE,
|
|
183
|
+
TAG_CTRL_HEADER,
|
|
184
|
+
TAG_DOC_CHAR_SHAPE,
|
|
185
|
+
TAG_DOC_PARA_SHAPE,
|
|
186
|
+
TAG_FACE_NAME,
|
|
187
|
+
TAG_ID_MAPPINGS,
|
|
188
|
+
TAG_LIST_HEADER,
|
|
189
|
+
TAG_PARA_HEADER,
|
|
190
|
+
TAG_PARA_LINE_SEG,
|
|
191
|
+
TAG_PARA_TEXT,
|
|
192
|
+
TAG_SHAPE_COMPONENT,
|
|
193
|
+
TAG_SHAPE_COMPONENT_PICTURE,
|
|
194
|
+
TAG_TABLE,
|
|
195
|
+
appendParaText,
|
|
196
|
+
blocksPlainText,
|
|
197
|
+
buildAddressedTable,
|
|
198
|
+
cellTextFromBlocks,
|
|
199
|
+
convertToHwpx,
|
|
200
|
+
createParaTextState,
|
|
201
|
+
decompressStream,
|
|
202
|
+
detectImageMime,
|
|
203
|
+
emitParagraphBlocks,
|
|
204
|
+
fileTimeText,
|
|
205
|
+
formatNumber,
|
|
206
|
+
hasRealStrike,
|
|
207
|
+
hasRealUnderline,
|
|
208
|
+
hwpEquationToLatex,
|
|
209
|
+
hwpToHwpx,
|
|
210
|
+
indexHwp5Tables,
|
|
211
|
+
isClickHereGuideText,
|
|
212
|
+
isExtendedOnlyCtrlChar,
|
|
213
|
+
locateMemoBlocks,
|
|
214
|
+
memosMarkdown,
|
|
215
|
+
openHwp5Container,
|
|
216
|
+
parseDocInfo,
|
|
217
|
+
parseFileHeader,
|
|
218
|
+
parseHwp5Document,
|
|
219
|
+
readHwp5BinData,
|
|
220
|
+
readHwp5DocInfoRecords,
|
|
221
|
+
readHwp5SectionRecords,
|
|
222
|
+
readHwp5SectionStreams,
|
|
223
|
+
readRecords,
|
|
224
|
+
resolveImageBlocks,
|
|
225
|
+
unfilledClickHereGuide
|
|
226
|
+
} from "./chunk-7KKL3PRK.js";
|
|
227
|
+
import {
|
|
228
|
+
MAX_PIXELS,
|
|
229
|
+
bmpToPng,
|
|
230
|
+
bmpToRgba,
|
|
231
|
+
inlineImagesIntoMarkdown
|
|
232
|
+
} from "./chunk-UJELMNOU.js";
|
|
233
|
+
import {
|
|
234
|
+
parsePageRange
|
|
235
|
+
} from "./chunk-V4BH5SRQ.js";
|
|
236
|
+
import {
|
|
237
|
+
parseLenientCfb
|
|
238
|
+
} from "./chunk-PDI54TF2.js";
|
|
233
239
|
import "./chunk-LT4QALSF.js";
|
|
234
240
|
import {
|
|
235
241
|
MAX_COLS,
|
|
@@ -252,7 +258,7 @@ import {
|
|
|
252
258
|
tidyScriptTags,
|
|
253
259
|
unframeLayoutTables,
|
|
254
260
|
wrapScript
|
|
255
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-LFFARZYZ.js";
|
|
256
262
|
import {
|
|
257
263
|
KordocError,
|
|
258
264
|
OPTIONAL_DEP_INSTALL_HINT,
|
|
@@ -268,7 +274,7 @@ import {
|
|
|
268
274
|
stripDtd,
|
|
269
275
|
toArrayBuffer,
|
|
270
276
|
unzipLimitBytes
|
|
271
|
-
} from "./chunk-
|
|
277
|
+
} from "./chunk-DAAJO62F.js";
|
|
272
278
|
|
|
273
279
|
// src/plain-markdown.ts
|
|
274
280
|
function toPlainMarkdown(md2) {
|
|
@@ -412,9 +418,9 @@ function decryptEntry(cipher, entry, startKey) {
|
|
|
412
418
|
const decipher = createDecipheriv("aes-256-cbc", key3, entry.iv);
|
|
413
419
|
decipher.setAutoPadding(false);
|
|
414
420
|
const raw = Buffer.concat([decipher.update(cipher), decipher.final()]);
|
|
415
|
-
const
|
|
416
|
-
const sum = createHash("sha256").update(
|
|
417
|
-
if (sum.length === entry.checksum.length && timingSafeEqual(sum, entry.checksum)) return
|
|
421
|
+
const plain3 = inflateRawSync(raw, { maxOutputLength: MAX_DECOMPRESS_SIZE });
|
|
422
|
+
const sum = createHash("sha256").update(plain3.subarray(0, Math.min(CHECKSUM_PREFIX_BYTES, plain3.length))).digest();
|
|
423
|
+
if (sum.length === entry.checksum.length && timingSafeEqual(sum, entry.checksum)) return plain3;
|
|
418
424
|
} catch {
|
|
419
425
|
}
|
|
420
426
|
}
|
|
@@ -432,15 +438,15 @@ async function decryptHwpxInPlace(zip, manifestXml, password) {
|
|
|
432
438
|
throw new KordocError(`\uC554\uD638 \uBAA9\uB85D\uC5D0 \uC788\uB294 \uD30C\uC77C\uC774 \uBB38\uC11C\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4: ${entry.path}`);
|
|
433
439
|
}
|
|
434
440
|
const raw = await readZipEntry(file, "uint8array", used);
|
|
435
|
-
const
|
|
436
|
-
if (!
|
|
441
|
+
const plain3 = decryptEntry(Buffer.from(raw.buffer, raw.byteOffset, raw.length), entry, startKey);
|
|
442
|
+
if (!plain3) {
|
|
437
443
|
throw new KordocError("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
438
444
|
}
|
|
439
|
-
used +=
|
|
445
|
+
used += plain3.length;
|
|
440
446
|
if (used > MAX_DECOMPRESS_SIZE) throw new ZipBombError("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
441
|
-
decrypted.push({ path: entry.path, plain:
|
|
447
|
+
decrypted.push({ path: entry.path, plain: plain3 });
|
|
442
448
|
}
|
|
443
|
-
for (const { path, plain:
|
|
449
|
+
for (const { path, plain: plain3 } of decrypted) zip.file(path, plain3);
|
|
444
450
|
zip.file("META-INF/manifest.xml", stripEncryptionData(manifestXml));
|
|
445
451
|
return decrypted.length;
|
|
446
452
|
}
|
|
@@ -15958,7 +15964,7 @@ async function parseHeaderFooterBlocks(zip, doc, rels, kind, styles, numbering,
|
|
|
15958
15964
|
return out;
|
|
15959
15965
|
}
|
|
15960
15966
|
async function parseDocxDocument(buffer, options) {
|
|
15961
|
-
const readImages = options?.images !== false;
|
|
15967
|
+
const readImages = options?.images !== false || !!options?.qrCodes;
|
|
15962
15968
|
precheckZipSize(buffer, MAX_DECOMPRESS_SIZE4, void 0, { re: MEDIA_PART_RE, skip: !readImages, never: NEVER_READ_RE });
|
|
15963
15969
|
const zip = await JSZip4.loadAsync(buffer);
|
|
15964
15970
|
const warnings = [];
|
|
@@ -16292,7 +16298,7 @@ async function pictureBlock(pic, ctx) {
|
|
|
16292
16298
|
const ext = partExtension(rel.target);
|
|
16293
16299
|
filename = `image_${String(ctx.imageNames.size + 1).padStart(3, "0")}.${ext}`;
|
|
16294
16300
|
try {
|
|
16295
|
-
if (ctx.options?.images !== false) {
|
|
16301
|
+
if (ctx.options?.images !== false || ctx.options?.qrCodes) {
|
|
16296
16302
|
const data = await readZipEntry(file, "uint8array");
|
|
16297
16303
|
ctx.images.push({ filename, data, mimeType: IMAGE_MIME[ext] ?? detectImageMime(data) ?? "application/octet-stream", source: rel.target });
|
|
16298
16304
|
}
|
|
@@ -16367,7 +16373,7 @@ async function notesText(zip, rels) {
|
|
|
16367
16373
|
return texts.join(" ");
|
|
16368
16374
|
}
|
|
16369
16375
|
async function parsePptxDocument(buffer, options) {
|
|
16370
|
-
precheckZipSize(buffer, MAX_DECOMPRESS_SIZE5, MAX_ZIP_ENTRIES2, { re: MEDIA_PART_RE2, skip: options?.images === false, never: NEVER_READ_RE2 });
|
|
16376
|
+
precheckZipSize(buffer, MAX_DECOMPRESS_SIZE5, MAX_ZIP_ENTRIES2, { re: MEDIA_PART_RE2, skip: options?.images === false && !options?.qrCodes, never: NEVER_READ_RE2 });
|
|
16371
16377
|
const zip = await JSZip5.loadAsync(buffer);
|
|
16372
16378
|
if (!zip.file("ppt/presentation.xml")) {
|
|
16373
16379
|
throw new KordocError("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 PPTX \uD30C\uC77C: ppt/presentation.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
@@ -17847,7 +17853,7 @@ var MIN_SIDE = 24;
|
|
|
17847
17853
|
async function ocrEmbeddedImages(blocks, options, warnings) {
|
|
17848
17854
|
const ocr = options?.ocr;
|
|
17849
17855
|
if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
|
|
17850
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
17856
|
+
const { parseImageDocument } = await import("./image-ocr-VIGZE4YL.js");
|
|
17851
17857
|
let inserted = false, unreadable = 0;
|
|
17852
17858
|
let failed = null;
|
|
17853
17859
|
const walk = async (list, depth) => {
|
|
@@ -17902,6 +17908,79 @@ async function tooSmall(bytes) {
|
|
|
17902
17908
|
}
|
|
17903
17909
|
}
|
|
17904
17910
|
|
|
17911
|
+
// src/image/format.ts
|
|
17912
|
+
var MIME = { png: "image/png", webp: "image/webp" };
|
|
17913
|
+
function isFormat(b, format2) {
|
|
17914
|
+
if (format2 === "png") return b[0] === 137 && b[1] === 80 && b[2] === 78 && b[3] === 71;
|
|
17915
|
+
return b.length >= 12 && b[0] === 82 && b[1] === 73 && b[2] === 70 && b[3] === 70 && b[8] === 87 && b[9] === 69 && b[10] === 66 && b[11] === 80;
|
|
17916
|
+
}
|
|
17917
|
+
var plain = (b) => b && new Uint8Array(b.buffer, b.byteOffset, b.byteLength);
|
|
17918
|
+
async function convert(sharp, img, format2) {
|
|
17919
|
+
if (isFormat(img.data, format2)) return img.data;
|
|
17920
|
+
if (img.data[0] === 66 && img.data[1] === 77) {
|
|
17921
|
+
if (format2 === "png") return bmpToPng(img.data);
|
|
17922
|
+
const px = bmpToRgba(img.data);
|
|
17923
|
+
if (!px || !sharp) return null;
|
|
17924
|
+
return plain(await sharp(toBuffer(px.data), { raw: { width: px.width, height: px.height, channels: 4 } }).webp(WEBP_OPTIONS).toBuffer().catch(() => null));
|
|
17925
|
+
}
|
|
17926
|
+
if (!sharp) return null;
|
|
17927
|
+
const out = sharp(toBuffer(img.data), { limitInputPixels: MAX_PIXELS }).rotate();
|
|
17928
|
+
return plain(await (format2 === "png" ? out.png() : out.webp(WEBP_OPTIONS)).toBuffer().catch(() => null));
|
|
17929
|
+
}
|
|
17930
|
+
async function convertImages(blocks, images, format2, warnings) {
|
|
17931
|
+
const sharp = await loadSharp();
|
|
17932
|
+
const names = new Set(images.map((i) => i.filename));
|
|
17933
|
+
const renamed = /* @__PURE__ */ new Map();
|
|
17934
|
+
const kept = [];
|
|
17935
|
+
for (const img of images) {
|
|
17936
|
+
const name = img.filename.replace(/\.[^./]*$/, "") + "." + format2;
|
|
17937
|
+
const data = await convert(sharp, img, format2);
|
|
17938
|
+
if (!data || name !== img.filename && names.has(name)) {
|
|
17939
|
+
kept.push(img.mimeType);
|
|
17940
|
+
continue;
|
|
17941
|
+
}
|
|
17942
|
+
if (name !== img.filename) {
|
|
17943
|
+
renamed.set(img.filename, img);
|
|
17944
|
+
names.add(name);
|
|
17945
|
+
}
|
|
17946
|
+
Object.assign(img, { filename: name, data, mimeType: MIME[format2] });
|
|
17947
|
+
}
|
|
17948
|
+
if (kept.length) {
|
|
17949
|
+
const byMime = [...new Set(kept)].map((m) => `${m} ${kept.filter((k) => k === m).length}`).join(", ");
|
|
17950
|
+
warnings.push({ code: "SKIPPED_IMAGE", message: `\uADF8\uB9BC ${kept.length}\uAC1C\uB294 ${format2.toUpperCase()} \uB85C \uBC14\uAFB8\uC9C0 \uBABB\uD574 \uC6D0\uBCF8 \uD615\uC2DD\uC73C\uB85C \uB0C8\uC2B5\uB2C8\uB2E4 (${byMime})${sharp ? "" : " \u2014 optional dependency 'sharp' \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4"}` });
|
|
17951
|
+
}
|
|
17952
|
+
const byName = new Map(images.map((i) => [i.filename, i]));
|
|
17953
|
+
const fix = (s) => s.includes(" ? s.replace(/!\[image\]\(([^()\s]+)\)/g, (m, name) => {
|
|
17954
|
+
const img = renamed.get(name);
|
|
17955
|
+
return img ? `` : m;
|
|
17956
|
+
}) : s;
|
|
17957
|
+
const walk = (list, depth) => {
|
|
17958
|
+
if (!list || depth > 64) return;
|
|
17959
|
+
for (const b of list) {
|
|
17960
|
+
if (b.type === "image" && b.text) {
|
|
17961
|
+
const img = renamed.get(b.text) ?? byName.get(b.text);
|
|
17962
|
+
if (img) {
|
|
17963
|
+
b.text = img.filename;
|
|
17964
|
+
if (b.imageData) b.imageData = { ...b.imageData, data: img.data, mimeType: img.mimeType };
|
|
17965
|
+
}
|
|
17966
|
+
} else if (b.text) b.text = fix(b.text);
|
|
17967
|
+
if (b.footnoteText) b.footnoteText = fix(b.footnoteText);
|
|
17968
|
+
walk(b.children, depth + 1);
|
|
17969
|
+
walk(b.footnoteBlocks, depth + 1);
|
|
17970
|
+
if (b.table) {
|
|
17971
|
+
if (b.table.caption) b.table.caption = fix(b.table.caption);
|
|
17972
|
+
for (const row of b.table.cells) for (const cell of row) {
|
|
17973
|
+
cell.text = fix(cell.text);
|
|
17974
|
+
walk(cell.blocks, depth + 1);
|
|
17975
|
+
}
|
|
17976
|
+
walk(b.table.captionBlocks, depth + 1);
|
|
17977
|
+
}
|
|
17978
|
+
}
|
|
17979
|
+
};
|
|
17980
|
+
walk(blocks, 0);
|
|
17981
|
+
return renamed.size > 0;
|
|
17982
|
+
}
|
|
17983
|
+
|
|
17905
17984
|
// src/table/classifier.ts
|
|
17906
17985
|
var DIAGRAM_KEYWORDS = /조직도|비상\s*연락망|연락망|체계도|업무\s*체계도|기구표|배치도|흐름도|추진\s*체계/u;
|
|
17907
17986
|
var KEYWORD_GATE = 0.3;
|
|
@@ -18406,11 +18485,11 @@ function parseParaGeom(el, oldUnit = false) {
|
|
|
18406
18485
|
}
|
|
18407
18486
|
const margin = findDeep(el, "margin");
|
|
18408
18487
|
if (margin) {
|
|
18409
|
-
const
|
|
18488
|
+
const plain3 = oldUnit && (margin.parentNode?.tagName ?? "").replace(/^[^:]+:/, "") === "paraPr";
|
|
18410
18489
|
const v = (n) => {
|
|
18411
18490
|
const c = findDeep(margin, n);
|
|
18412
18491
|
const x = c ? (Number(c.getAttribute("value")) || 0) * (c.getAttribute("unit") === "CHAR" ? 5 : 1) : 0;
|
|
18413
|
-
return
|
|
18492
|
+
return plain3 ? Math.trunc(x / 2) : x;
|
|
18414
18493
|
};
|
|
18415
18494
|
g3.marginLeft = v("left");
|
|
18416
18495
|
g3.marginRight = v("right");
|
|
@@ -18601,7 +18680,7 @@ function parseRenderStyles(headXml, opts) {
|
|
|
18601
18680
|
// src/form/seal.ts
|
|
18602
18681
|
var HU_PER_MM = 7200 / 25.4;
|
|
18603
18682
|
var mm2hu = (mm) => Math.round(mm * HU_PER_MM);
|
|
18604
|
-
var
|
|
18683
|
+
var MIME2 = {
|
|
18605
18684
|
png: "image/png",
|
|
18606
18685
|
jpg: "image/jpeg",
|
|
18607
18686
|
jpeg: "image/jpeg",
|
|
@@ -18780,7 +18859,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
18780
18859
|
if (!op.anchor) throw new KordocError("place_seal: anchor \uBB38\uAD6C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
18781
18860
|
if (!op.image || op.image.length === 0) throw new KordocError("place_seal: \uB3C4\uC7A5 \uC774\uBBF8\uC9C0\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
18782
18861
|
const ext = (op.ext ?? "png").toLowerCase();
|
|
18783
|
-
if (!
|
|
18862
|
+
if (!MIME2[ext]) throw new KordocError(`place_seal: \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC774\uBBF8\uC9C0 \uD655\uC7A5\uC790 .${ext} (png/jpg/bmp/gif)`);
|
|
18784
18863
|
if (!imageMagicMatches(op.image, ext)) throw new KordocError(`place_seal: \uC774\uBBF8\uC9C0 \uB0B4\uC6A9\uC774 .${ext} \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 (\uB9E4\uC9C1\uBC14\uC774\uD2B8 \uBD88\uC77C\uCE58)`);
|
|
18785
18864
|
const wantOcc = op.occurrence ?? 0;
|
|
18786
18865
|
let found = null;
|
|
@@ -18852,7 +18931,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
18852
18931
|
const itemId = `image${n}`;
|
|
18853
18932
|
usedIds.add(itemId);
|
|
18854
18933
|
additions.set(entry, op.image);
|
|
18855
|
-
manifestItems.push(`<opf:item id="${itemId}" href="${entry}" media-type="${
|
|
18934
|
+
manifestItems.push(`<opf:item id="${itemId}" href="${entry}" media-type="${MIME2[ext]}" isEmbeded="1"/>`);
|
|
18856
18935
|
const pic = buildFloatPicXml(itemId, mm2hu(sizeMm), mm2hu(posXMm), mm2hu(posYMm), {
|
|
18857
18936
|
id: ++maxId,
|
|
18858
18937
|
instid: ++maxId
|
|
@@ -19035,12 +19114,12 @@ function protoStyle(xml, ix) {
|
|
|
19035
19114
|
if (!p) return null;
|
|
19036
19115
|
const model = parsePara(xml, p);
|
|
19037
19116
|
const paraPr = /\bparaPrIDRef="(\d+)"/.exec(xml.slice(p.start, p.openEnd))?.[1] ?? "0";
|
|
19038
|
-
const
|
|
19039
|
-
let prefix = /^[\s ]*/.exec(
|
|
19040
|
-
const cp =
|
|
19117
|
+
const plain3 = paraPlain(model);
|
|
19118
|
+
let prefix = /^[\s ]*/.exec(plain3)[0].length;
|
|
19119
|
+
const cp = plain3.codePointAt(prefix);
|
|
19041
19120
|
if (cp !== void 0 && isMarkerChar(mapPuaText(String.fromCodePoint(cp)))) {
|
|
19042
19121
|
prefix += String.fromCodePoint(cp).length;
|
|
19043
|
-
prefix += /^[\s ]*/.exec(
|
|
19122
|
+
prefix += /^[\s ]*/.exec(plain3.slice(prefix))[0].length;
|
|
19044
19123
|
}
|
|
19045
19124
|
let best = "", bestN = 0, pos = 0;
|
|
19046
19125
|
for (const r of model.runs) {
|
|
@@ -19287,9 +19366,9 @@ var scrubText = (t) => t.replace(ROLE_LABEL_RE, (_m, label) => `${label}\u25CB\u
|
|
|
19287
19366
|
function scrubPeople(xml) {
|
|
19288
19367
|
return xml.replace(/(<hp:t\b(?:[^>/]|\/(?!>)){0,256}>)([\s\S]{0,65536}?)(<\/hp:t>)/g, (all, open, body, close) => {
|
|
19289
19368
|
if (!body.includes("<")) return open + scrubText(body) + close;
|
|
19290
|
-
const
|
|
19291
|
-
const out = scrubText(
|
|
19292
|
-
return out ===
|
|
19369
|
+
const plain3 = body.replace(/<hp:(?:fwSpace|nbSpace)\/>/g, " ").replace(/<hp:tab\b[^>]{0,256}\/>/g, " ").replace(/<[^>]{1,1024}>/g, "");
|
|
19370
|
+
const out = scrubText(plain3);
|
|
19371
|
+
return out === plain3 ? all : open + out.replace(/&(?!(?:amp|lt|gt|quot|apos);)/g, "&").replace(/</g, "<") + close;
|
|
19293
19372
|
});
|
|
19294
19373
|
}
|
|
19295
19374
|
function scrubMeta(hpf) {
|
|
@@ -20509,7 +20588,7 @@ function classify(raw) {
|
|
|
20509
20588
|
if (li) return { kind: indent >= 2 ? "sub" : "item", body: li[1].trim() };
|
|
20510
20589
|
return { kind: "para", body: t };
|
|
20511
20590
|
}
|
|
20512
|
-
function
|
|
20591
|
+
function plain2(s) {
|
|
20513
20592
|
return s.replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/(\*\*|__|~~|`)/g, "").trim();
|
|
20514
20593
|
}
|
|
20515
20594
|
function stripQuoted(s) {
|
|
@@ -20614,11 +20693,11 @@ function lintMuncheText(text) {
|
|
|
20614
20693
|
continue;
|
|
20615
20694
|
}
|
|
20616
20695
|
if (c.kind === "lead") {
|
|
20617
|
-
leadBuf.push({ line: no, body:
|
|
20696
|
+
leadBuf.push({ line: no, body: plain2(c.body) });
|
|
20618
20697
|
continue;
|
|
20619
20698
|
}
|
|
20620
20699
|
flushLead();
|
|
20621
|
-
const b =
|
|
20700
|
+
const b = plain2(c.body);
|
|
20622
20701
|
if (!b) continue;
|
|
20623
20702
|
const q = stripQuoted(b);
|
|
20624
20703
|
if (c.kind === "item" || c.kind === "sub" || c.kind === "concl" || c.kind === "para") {
|
|
@@ -21438,9 +21517,9 @@ var UNIT_NOTE_RE = new RegExp(String.raw`[((]\s*(?:단위\s*[::]\s*)?(${unit
|
|
|
21438
21517
|
var BOUND_AFTER = /^\s?(?:이상|이하|초과|미만|내외|수준|안팎|가량|정도)/;
|
|
21439
21518
|
var BOUND_BEFORE = /(?:목표|기준|상한|하한|최소|최대|약)[^\d]{0,8}$/;
|
|
21440
21519
|
function canonicalValue(text) {
|
|
21441
|
-
const
|
|
21442
|
-
if (!
|
|
21443
|
-
return
|
|
21520
|
+
const plain3 = text.replace(/,/g, "");
|
|
21521
|
+
if (!plain3.includes(".")) return plain3;
|
|
21522
|
+
return plain3.replace(/0+$/, "").replace(/\.$/, "");
|
|
21444
21523
|
}
|
|
21445
21524
|
var isDistinctive = (value) => value.includes(".") || value.replace(/^0+/, "").length >= 3;
|
|
21446
21525
|
function indexTable(rows, at) {
|
|
@@ -22543,15 +22622,15 @@ function scanTableParagraphs(table) {
|
|
|
22543
22622
|
return out.sort((a, b) => a.start - b.start);
|
|
22544
22623
|
}
|
|
22545
22624
|
var LEAD_RE = /^[-•·◦○□■▪▶►※*ㅇ❍➊-➓①-⑳]$/u;
|
|
22546
|
-
function withOptionalLeads(
|
|
22547
|
-
const opt = new Array(
|
|
22625
|
+
function withOptionalLeads(plain3) {
|
|
22626
|
+
const opt = new Array(plain3.length).fill(false);
|
|
22548
22627
|
let at = 0;
|
|
22549
|
-
for (const line of
|
|
22628
|
+
for (const line of plain3.split("\n")) {
|
|
22550
22629
|
const w = line.match(/^(\S+)\s/)?.[1];
|
|
22551
22630
|
if (w && (LEAD_RE.test(w) || AUTONUM_PREFIX_RE.test(w))) for (let k = 0; k < w.length; k++) opt[at + k] = true;
|
|
22552
22631
|
at += line.length + 1;
|
|
22553
22632
|
}
|
|
22554
|
-
return { text:
|
|
22633
|
+
return { text: plain3.replace(/\n/g, " "), opt };
|
|
22555
22634
|
}
|
|
22556
22635
|
function findRuns(texts, target, opt) {
|
|
22557
22636
|
const tch = [], topt = [];
|
|
@@ -25054,15 +25133,15 @@ function patchLineBreakParagraph(block, orig, edited, mapping, ctx, skip) {
|
|
|
25054
25133
|
if (block.footnoteText || mapping.noteMarks?.length || mapping.prefixStripped) {
|
|
25055
25134
|
return skip("\uAC15\uC81C \uC904\uBC14\uAFC8 \uBB38\uB2E8\uC758 \uAC01\uC8FC\xB7\uC790\uB3D9\uBC88\uD638 \u2014 \uC218\uC815 \uBBF8\uC9C0\uC6D0");
|
|
25056
25135
|
}
|
|
25057
|
-
const
|
|
25058
|
-
let origNorm =
|
|
25059
|
-
let newNorm =
|
|
25136
|
+
const plain3 = (raw) => parseEmphasis(textUnitInline(raw, block, "\n")).plain;
|
|
25137
|
+
let origNorm = plain3(orig.raw);
|
|
25138
|
+
let newNorm = plain3(edited.raw);
|
|
25060
25139
|
if (newNorm === origNorm) return skip("\uD14D\uC2A4\uD2B8 \uC678 \uBCC0\uACBD(\uD5E4\uB529 \uB808\uBCA8/\uC11C\uC2DD)\uB9CC \uAC10\uC9C0 \u2014 \uC2A4\uD0C0\uC77C \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0");
|
|
25061
25140
|
if (newNorm.split("\n").some((l) => sanitizeText(l) !== l) && origNorm.split("\n").every((l) => sanitizeText(l) === l)) {
|
|
25062
25141
|
return skip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uD328\uCE58 \uC2DC \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
|
|
25063
25142
|
}
|
|
25064
25143
|
if (orig.part !== void 0) {
|
|
25065
|
-
const parts = splitMarkdownUnits(blocksToMarkdown([block])).map((u) =>
|
|
25144
|
+
const parts = splitMarkdownUnits(blocksToMarkdown([block])).map((u) => plain3(u.raw));
|
|
25066
25145
|
if (parts[orig.part] !== origNorm) return skip("\uBB38\uB2E8 \uBD84\uC808(\uAC15\uC81C \uC904\uBC14\uAFC8) \uC870\uAC01 \uB9E4\uD551 \uC2E4\uD328 \u2014 \uBBF8\uC9C0\uC6D0");
|
|
25067
25146
|
origNorm = parts.join("\n\n");
|
|
25068
25147
|
parts[orig.part] = newNorm;
|
|
@@ -30634,7 +30713,7 @@ function planTableRows(tbl, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan, n
|
|
|
30634
30713
|
const nRows = rowH.length;
|
|
30635
30714
|
const rowY = [0];
|
|
30636
30715
|
for (const h of rowH) rowY.push(rowY[rowY.length - 1] + h);
|
|
30637
|
-
const
|
|
30716
|
+
const plain3 = () => rowH.map((h, r) => [{ page: 0, y: ty + rowY[r], h }]);
|
|
30638
30717
|
const pageBottom = MT + BODY_H;
|
|
30639
30718
|
const stackOver = tbl.getAttribute("pageBreak") === "CELL" && rowH.some((h, r) => {
|
|
30640
30719
|
const rc = cells.filter((c) => c.ra === r && c.rs === 1);
|
|
@@ -30648,10 +30727,10 @@ function planTableRows(tbl, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan, n
|
|
|
30648
30727
|
if (rowY.some((v, k) => k > 0 && k < nRows && Math.abs(v - declared) <= 2)) slack = 0;
|
|
30649
30728
|
}
|
|
30650
30729
|
const savedParts = tbl.getAttribute("pageBreak") === "CELL" && cells.some((c) => c.h > rowY[nRows] && cellLineBoxes(c, BODY_H).some((b) => b.part > 0));
|
|
30651
|
-
if (BODY_H <= 0 || ty + rowY[nRows] <= pageBottom + slack && !stackOver && !savedParts) return
|
|
30730
|
+
if (BODY_H <= 0 || ty + rowY[nRows] <= pageBottom + slack && !stackOver && !savedParts) return plain3();
|
|
30652
30731
|
if (findChildByLocalName(tbl, "pos")?.getAttribute("treatAsChar") === "1") {
|
|
30653
30732
|
const declared = num2(findChildByLocalName(tbl, "sz"), "height") || rowY[nRows];
|
|
30654
|
-
if (ty - MT < 2e3 || ty + declared <= pageBottom + slack) return
|
|
30733
|
+
if (ty - MT < 2e3 || ty + declared <= pageBottom + slack) return plain3();
|
|
30655
30734
|
return rowH.map((h, r) => [{ page: 1, y: MT + rowY[r], h }]);
|
|
30656
30735
|
}
|
|
30657
30736
|
let hdrRows = 0;
|
|
@@ -33564,7 +33643,7 @@ async function actualSize(sharp, data, fallbackW, fallbackH) {
|
|
|
33564
33643
|
}
|
|
33565
33644
|
return { w: fallbackW, h: fallbackH };
|
|
33566
33645
|
}
|
|
33567
|
-
async function
|
|
33646
|
+
async function loadSharp2() {
|
|
33568
33647
|
try {
|
|
33569
33648
|
const mod = await import("sharp");
|
|
33570
33649
|
return mod.default ?? mod;
|
|
@@ -33575,7 +33654,7 @@ async function loadSharp() {
|
|
|
33575
33654
|
}
|
|
33576
33655
|
}
|
|
33577
33656
|
async function rasterizePageSvg(svg, widthPt, heightPt, options = {}) {
|
|
33578
|
-
const sharp = await
|
|
33657
|
+
const sharp = await loadSharp2();
|
|
33579
33658
|
if (!(widthPt > 0) || !(heightPt > 0)) throw new KordocError(`\uC798\uBABB\uB41C \uD398\uC774\uC9C0 \uD06C\uAE30: ${widthPt}x${heightPt}pt`);
|
|
33580
33659
|
const maxW = options.maxWidthPx ?? 1400;
|
|
33581
33660
|
const maxH = options.maxHeightPx ?? 4e3;
|
|
@@ -33701,7 +33780,7 @@ async function extractRenderedRegions(input, options = {}) {
|
|
|
33701
33780
|
const byPage = /* @__PURE__ */ new Map();
|
|
33702
33781
|
for (const r of wanted) for (const b of r.regions) if (pageSvgs.has(b.page)) (byPage.get(b.page) ?? byPage.set(b.page, []).get(b.page)).push({ region: r, bbox: b });
|
|
33703
33782
|
if (byPage.size === 0) return [];
|
|
33704
|
-
const sharp = await
|
|
33783
|
+
const sharp = await loadSharp2();
|
|
33705
33784
|
const out = [];
|
|
33706
33785
|
for (const [page, items] of [...byPage.entries()].sort((a, b) => a[0] - b[0])) {
|
|
33707
33786
|
const meta = scene.pages.find((p) => p.page === page);
|
|
@@ -33874,21 +33953,35 @@ async function dispatch(format2, buffer, opts) {
|
|
|
33874
33953
|
async function withEmbeddedImageOcr(blocks, markdown, warnings, images, options) {
|
|
33875
33954
|
const list = [...warnings ?? []];
|
|
33876
33955
|
if (!await ocrEmbeddedImages(blocks, options, list)) return { markdown, warnings: list.length ? list : void 0 };
|
|
33877
|
-
|
|
33878
|
-
|
|
33879
|
-
|
|
33880
|
-
|
|
33881
|
-
|
|
33882
|
-
|
|
33956
|
+
return { markdown: blocksMarkdown(blocks, options, images), warnings: list.length ? list : void 0 };
|
|
33957
|
+
}
|
|
33958
|
+
async function withImageQr(blocks, markdown, warnings, images, options, inline) {
|
|
33959
|
+
if (!options?.qrCodes) return { markdown, warnings };
|
|
33960
|
+
const list = [...warnings ?? []];
|
|
33961
|
+
const found = await readImageQrCodes(blocks, images, list);
|
|
33962
|
+
return { markdown: found ? blocksMarkdown(blocks, options, inline) : markdown, warnings: list.length ? list : void 0 };
|
|
33963
|
+
}
|
|
33964
|
+
async function withImageFormat(blocks, markdown, warnings, images, options, inline) {
|
|
33965
|
+
if (!options?.imageFormat || options.images === false || !images?.length) return { markdown, warnings };
|
|
33966
|
+
const list = [...warnings ?? []];
|
|
33967
|
+
const renamed = await convertImages(blocks, images, options.imageFormat, list);
|
|
33968
|
+
return { markdown: renamed ? blocksMarkdown(blocks, options, inline) : markdown, warnings: list.length ? list : void 0 };
|
|
33969
|
+
}
|
|
33970
|
+
function blocksMarkdown(blocks, options, images) {
|
|
33971
|
+
const md2 = blocksToMarkdown(blocks, { tableFormat: options?.tableFormat });
|
|
33972
|
+
if (!(options?.inlineImages && options.images !== false && images?.length)) return md2;
|
|
33973
|
+
try {
|
|
33974
|
+
return inlineImagesIntoMarkdown(md2, images, { compress: true });
|
|
33975
|
+
} catch {
|
|
33976
|
+
return md2;
|
|
33883
33977
|
}
|
|
33884
|
-
return { markdown: md2, warnings: list.length ? list : void 0 };
|
|
33885
33978
|
}
|
|
33886
33979
|
function scriptsOff(r, off) {
|
|
33887
33980
|
return off ? stripScriptTags(r) : r;
|
|
33888
33981
|
}
|
|
33889
33982
|
async function parseImage(buffer, options) {
|
|
33890
33983
|
try {
|
|
33891
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
33984
|
+
const { parseImageDocument } = await import("./image-ocr-VIGZE4YL.js");
|
|
33892
33985
|
const { blocks, warnings, lines } = await parseImageDocument(buffer, options);
|
|
33893
33986
|
stripScriptTags({ blocks });
|
|
33894
33987
|
return {
|
|
@@ -33907,7 +34000,9 @@ async function parseImage(buffer, options) {
|
|
|
33907
34000
|
async function parseHwp3(buffer, options) {
|
|
33908
34001
|
try {
|
|
33909
34002
|
const { markdown, blocks, metadata, outline, warnings, images } = parseHwp3Document(buffer, options);
|
|
33910
|
-
|
|
34003
|
+
const qr = await withImageQr(blocks, markdown, warnings, images, options, images);
|
|
34004
|
+
const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options, images);
|
|
34005
|
+
return { success: true, fileType: "hwp3", markdown: webp.markdown, blocks, metadata, outline, warnings: webp.warnings, images, pageCount: metadata?.pageCount };
|
|
33911
34006
|
} catch (err) {
|
|
33912
34007
|
return { success: false, fileType: "hwp3", error: sanitizeError(err), code: classifyError(err) };
|
|
33913
34008
|
}
|
|
@@ -33917,8 +34012,10 @@ async function parseHwpx(buffer, options) {
|
|
|
33917
34012
|
const doc = await parseHwpxDocument(buffer, options);
|
|
33918
34013
|
const { blocks, metadata, outline, images, memos } = doc;
|
|
33919
34014
|
const ocr = await withEmbeddedImageOcr(blocks, doc.markdown, doc.warnings, void 0, options);
|
|
33920
|
-
const
|
|
33921
|
-
|
|
34015
|
+
const qr = await withImageQr(blocks, ocr.markdown, ocr.warnings, images, options);
|
|
34016
|
+
const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options);
|
|
34017
|
+
const markdown = options?.memos && memos?.length ? webp.markdown + memosMarkdown(memos) : webp.markdown;
|
|
34018
|
+
return scriptsOff({ success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings: webp.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount, ...memos?.length ? { memos } : {} }, options?.scriptTags === false);
|
|
33922
34019
|
} catch (err) {
|
|
33923
34020
|
return { success: false, fileType: "hwpx", error: sanitizeError(err), code: classifyError(err) };
|
|
33924
34021
|
}
|
|
@@ -33945,8 +34042,10 @@ async function parseHwp(buffer, options) {
|
|
|
33945
34042
|
}
|
|
33946
34043
|
}
|
|
33947
34044
|
const ocred = await withEmbeddedImageOcr(blocks, markdown, warnings, images, options);
|
|
33948
|
-
const
|
|
33949
|
-
|
|
34045
|
+
const qr = await withImageQr(blocks, ocred.markdown, ocred.warnings, images, options, images);
|
|
34046
|
+
const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options, images);
|
|
34047
|
+
const md2 = options?.memos && memos?.length ? webp.markdown + memosMarkdown(memos) : webp.markdown;
|
|
34048
|
+
return scriptsOff({ success: true, fileType: "hwp", markdown: md2, blocks, metadata, outline, warnings: webp.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount, ...memos?.length ? { memos } : {} }, options?.scriptTags === false);
|
|
33950
34049
|
} catch (err) {
|
|
33951
34050
|
return { success: false, fileType: "hwp", error: sanitizeError(err), code: classifyError(err) };
|
|
33952
34051
|
}
|
|
@@ -33954,7 +34053,7 @@ async function parseHwp(buffer, options) {
|
|
|
33954
34053
|
async function parsePdf(buffer, options) {
|
|
33955
34054
|
let parsePdfDocument;
|
|
33956
34055
|
try {
|
|
33957
|
-
const mod = await import("./parser-
|
|
34056
|
+
const mod = await import("./parser-XFU3VRWM.js");
|
|
33958
34057
|
parsePdfDocument = mod.parsePdfDocument;
|
|
33959
34058
|
} catch {
|
|
33960
34059
|
return {
|
|
@@ -33991,7 +34090,9 @@ async function parseXls(buffer, options) {
|
|
|
33991
34090
|
async function parseDocx(buffer, options) {
|
|
33992
34091
|
try {
|
|
33993
34092
|
const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
|
|
33994
|
-
|
|
34093
|
+
const qr = await withImageQr(blocks, markdown, warnings, images, options);
|
|
34094
|
+
const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options);
|
|
34095
|
+
return scriptsOff({ success: true, fileType: "docx", markdown: webp.markdown, blocks, metadata, outline, warnings: webp.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount }, options?.scriptTags === false);
|
|
33995
34096
|
} catch (err) {
|
|
33996
34097
|
return { success: false, fileType: "docx", error: sanitizeError(err), code: classifyError(err) };
|
|
33997
34098
|
}
|
|
@@ -33999,7 +34100,9 @@ async function parseDocx(buffer, options) {
|
|
|
33999
34100
|
async function parsePptx(buffer, options) {
|
|
34000
34101
|
try {
|
|
34001
34102
|
const { markdown, blocks, metadata, outline, warnings, images } = await parsePptxDocument(buffer, options);
|
|
34002
|
-
|
|
34103
|
+
const qr = await withImageQr(blocks, markdown, warnings, images, options);
|
|
34104
|
+
const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options);
|
|
34105
|
+
return scriptsOff({ success: true, fileType: "pptx", markdown: webp.markdown, blocks, metadata, outline, warnings: webp.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount }, options?.scriptTags === false);
|
|
34003
34106
|
} catch (err) {
|
|
34004
34107
|
return { success: false, fileType: "pptx", error: sanitizeError(err), code: classifyError(err) };
|
|
34005
34108
|
}
|
|
@@ -34030,7 +34133,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
34030
34133
|
throw new Error(`hwpx-preserve \uD3EC\uB9F7\uC740 HWPX\xB7HWP 5.x \uC785\uB825\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4 (\uAC10\uC9C0\uB41C \uD3EC\uB9F7: ${zipFormat})`);
|
|
34031
34134
|
}
|
|
34032
34135
|
} else if (format2 === "hwp" && detectOle2Format(buffer) === "hwp") {
|
|
34033
|
-
const { hwpToHwpx: hwpToHwpx2 } = await import("./to-hwpx-
|
|
34136
|
+
const { hwpToHwpx: hwpToHwpx2 } = await import("./to-hwpx-ZWN64NCQ.js");
|
|
34034
34137
|
const hwpx = await hwpToHwpx2(new Uint8Array(buffer));
|
|
34035
34138
|
buffer = hwpx.buffer.slice(hwpx.byteOffset, hwpx.byteOffset + hwpx.byteLength);
|
|
34036
34139
|
} else {
|