kordoc 4.24.76 → 4.24.77
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 -2
- package/dist/{-2LCJEMU4.js → -5UTN72IU.js} +22 -22
- package/dist/{chunk-43VUUMKV.cjs → chunk-3FCFBMS5.cjs} +6 -6
- package/dist/{chunk-43VUUMKV.cjs.map → chunk-3FCFBMS5.cjs.map} +1 -1
- package/dist/{chunk-J6RLB6KE.js → chunk-4MAW3JZO.js} +2 -2
- package/dist/{chunk-CWEB4XAH.js → chunk-5D25RVT5.js} +5 -5
- package/dist/{chunk-E2RQPNXX.js → chunk-5TM34VJ5.js} +2 -2
- package/dist/{chunk-RNBBMRKF.js → chunk-5XWGKCPA.js} +2 -2
- package/dist/{chunk-PE3XRCTM.js → chunk-67WGWE23.js} +4 -4
- package/dist/{chunk-T7YHAP4A.js → chunk-6P3XVII7.js} +3 -3
- package/dist/{chunk-DTKVCSRC.js → chunk-7AWQXTSU.js} +2 -2
- package/dist/{chunk-2ZQUSUDC.js → chunk-7Y2RNRWL.js} +5 -5
- package/dist/{chunk-IRCO55NY.js → chunk-A7VTEP5R.js} +2 -2
- package/dist/{chunk-TGM5V7UD.js → chunk-AMSLIVAC.js} +2 -2
- package/dist/{chunk-MHDVZBUV.js → chunk-AOBRIYGM.js} +2 -2
- package/dist/{chunk-MQ44UJN6.js → chunk-BFAGTWOT.js} +10 -6
- package/dist/chunk-BFAGTWOT.js.map +1 -0
- package/dist/{chunk-MRHLGVK5.js → chunk-BPMDM3JP.js} +2 -2
- package/dist/{chunk-PJ32UFPA.js → chunk-CG4BCYQ2.js} +2 -2
- package/dist/{chunk-2P5GYSEI.js → chunk-CNUWB5NK.js} +2 -2
- package/dist/{chunk-QDETIVPA.js → chunk-D4XGVKQV.js} +6 -6
- package/dist/{chunk-A7QRUXCJ.cjs → chunk-DGOTUUCW.cjs} +3 -3
- package/dist/{chunk-A7QRUXCJ.cjs.map → chunk-DGOTUUCW.cjs.map} +1 -1
- package/dist/{chunk-QIVOVMEC.cjs → chunk-DZX2B4CB.cjs} +2 -2
- package/dist/{chunk-QIVOVMEC.cjs.map → chunk-DZX2B4CB.cjs.map} +1 -1
- package/dist/{chunk-ODJRLTXE.js → chunk-EFLSK5JD.js} +2 -2
- package/dist/{chunk-DIUYXWT2.cjs → chunk-ENGSBT44.cjs} +3 -3
- package/dist/{chunk-DIUYXWT2.cjs.map → chunk-ENGSBT44.cjs.map} +1 -1
- package/dist/{chunk-4L3SF7EF.js → chunk-ERMTVALW.js} +2 -2
- package/dist/{chunk-PATC34WZ.js → chunk-F33LA2ET.js} +111 -12
- package/dist/chunk-F33LA2ET.js.map +1 -0
- package/dist/{chunk-V3MVGLWO.js → chunk-GCUP3CBW.js} +5 -5
- package/dist/{chunk-ZWA3MWAE.js → chunk-GUTZU7XE.js} +3 -3
- package/dist/{chunk-BUZLNJXB.js → chunk-H7HRVW32.js} +2 -2
- package/dist/{chunk-QCH63KBP.cjs → chunk-HDDU4LP5.cjs} +104 -104
- package/dist/{chunk-QCH63KBP.cjs.map → chunk-HDDU4LP5.cjs.map} +1 -1
- package/dist/{chunk-2P3SFHOF.cjs → chunk-JVM237XE.cjs} +88 -88
- package/dist/{chunk-2P3SFHOF.cjs.map → chunk-JVM237XE.cjs.map} +1 -1
- package/dist/{chunk-SABDVSQU.js → chunk-K6YLVT6X.js} +11 -11
- package/dist/{chunk-JYNG27VR.js → chunk-LGQ75OKH.js} +9 -5
- package/dist/chunk-LGQ75OKH.js.map +1 -0
- package/dist/{chunk-XM4VBVYH.cjs → chunk-LHHZZVRD.cjs} +8 -8
- package/dist/{chunk-XM4VBVYH.cjs.map → chunk-LHHZZVRD.cjs.map} +1 -1
- package/dist/{chunk-HHRQX733.cjs → chunk-O5IIMWXC.cjs} +31 -27
- package/dist/chunk-O5IIMWXC.cjs.map +1 -0
- package/dist/{chunk-SQ7BI34M.js → chunk-OLO76CMN.js} +3 -3
- package/dist/{chunk-XIUXBJHE.js → chunk-P6GTNKAA.js} +2 -2
- package/dist/{chunk-RZXJFM3A.js → chunk-QJ7MMZUI.js} +2 -2
- package/dist/{chunk-LFXIZHPE.js → chunk-QWK3DGUI.js} +16 -16
- package/dist/{chunk-U7EJ6QY7.js → chunk-SAUEKG7G.js} +3 -3
- package/dist/{chunk-XOC5PVAC.js → chunk-SKP4XXCB.js} +2 -2
- package/dist/{chunk-JT54JHR3.js → chunk-T424VUF7.js} +2 -2
- package/dist/{chunk-45AT4XJD.js → chunk-UFTF2BO7.js} +2 -2
- package/dist/{chunk-DKRKNL2X.cjs → chunk-UIHCY476.cjs} +58 -58
- package/dist/{chunk-DKRKNL2X.cjs.map → chunk-UIHCY476.cjs.map} +1 -1
- package/dist/{chunk-ODQJEBCB.js → chunk-UN3YZZNT.js} +2 -2
- package/dist/{chunk-HQXVNLH2.js → chunk-XY5BFX3H.js} +6 -6
- package/dist/{chunk-3X3ETOLW.js → chunk-Y2RWVFGG.js} +7 -7
- package/dist/{chunk-WTKISVEW.js → chunk-YSOXWADD.js} +2 -2
- package/dist/{chunk-4RB5OPUZ.js → chunk-ZZNZGQRX.js} +2 -2
- package/dist/chunks-QN364YXU.js +11 -0
- package/dist/cli.js +46 -46
- package/dist/{formula-3RUSZL2X.js → formula-37OIV2H3.js} +4 -4
- package/dist/{formula-UJKRUT4H.js → formula-P6EJMUKF.js} +3 -3
- package/dist/{formula-PNWIA2MN.cjs → formula-YN4NKDPV.cjs} +9 -9
- package/dist/{formula-PNWIA2MN.cjs.map → formula-YN4NKDPV.cjs.map} +1 -1
- package/dist/generator-6YDUW5RE.cjs +12 -0
- package/dist/{generator-3S2MTXHO.cjs.map → generator-6YDUW5RE.cjs.map} +1 -1
- package/dist/generator-C5FWPI6A.js +18 -0
- package/dist/generator-JX3OZYTO.js +11 -0
- package/dist/{hancom-VLS77NRS.js → hancom-547ZXYYE.js} +2 -2
- package/dist/{hancom-4LFQU2RS.js → hancom-GOOSRL7W.js} +2 -2
- package/dist/{hancom-35Z4YAJB.cjs → hancom-LKRD7PXX.cjs} +5 -5
- package/dist/{hancom-35Z4YAJB.cjs.map → hancom-LKRD7PXX.cjs.map} +1 -1
- package/dist/{image-ocr-CCLUXSWY.js → image-ocr-6HQTBMLN.js} +11 -11
- package/dist/{image-ocr-AGEB22EF.cjs → image-ocr-EZEOBMEQ.cjs} +36 -36
- package/dist/{image-ocr-AGEB22EF.cjs.map → image-ocr-EZEOBMEQ.cjs.map} +1 -1
- package/dist/{image-ocr-B7RRK43I.js → image-ocr-RNY2H3HS.js} +8 -8
- package/dist/index.cjs +1214 -1115
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +111 -12
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +37 -37
- package/dist/memo-RE3TCSXK.js +17 -0
- package/dist/{model-bundle-KFPWVEFB.js → model-bundle-ZYGK4G65.js} +5 -5
- package/dist/{models-IOX5WK67.js → models-K65TUK4Q.js} +5 -5
- package/dist/{parse-worker-v2-IL6U65X3.js → parse-worker-v2-VOM4DPZV.js} +23 -23
- package/dist/{parser-ANWES7Z3.js → parser-6KOCPC6H.js} +22 -13
- package/dist/{parser-ANWES7Z3.js.map → parser-6KOCPC6H.js.map} +1 -1
- package/dist/{parser-NCSJG5KJ.cjs → parser-7V6AQMPT.cjs} +176 -167
- package/dist/parser-7V6AQMPT.cjs.map +1 -0
- package/dist/{parser-ATU5CQZY.js → parser-SNW4ZFUX.js} +19 -10
- package/dist/{parser-ATU5CQZY.js.map → parser-SNW4ZFUX.js.map} +1 -1
- package/dist/{pdf-ocr-7IH7FGKQ.js → pdf-ocr-2JDCK34V.js} +9 -9
- package/dist/pdf-ocr-A4GJJCT3.cjs +43 -0
- package/dist/{pdf-ocr-F3ABLLXD.cjs.map → pdf-ocr-A4GJJCT3.cjs.map} +1 -1
- package/dist/{pdf-ocr-ZUGHKM32.js → pdf-ocr-JNCOGFLO.js} +6 -6
- package/dist/{profile-io-BGUQJDGK.js → profile-io-WHUZPJEM.js} +3 -3
- package/dist/{rasterize-JOAG2QCQ.js → rasterize-XR5V2FQQ.js} +3 -3
- package/dist/{redact-doc-WL2GWBMN.js → redact-doc-5FMV7KOY.js} +22 -22
- package/dist/{render-672D354C.js → render-OKC4QJUY.js} +12 -12
- package/dist/{rewrite-fallback-2JAAIU6G.js → rewrite-fallback-Y6ZUV6GG.js} +13 -13
- package/dist/seal-VMMMFVLG.js +16 -0
- package/dist/{setup-L4PVFG65.js → setup-Q6CIDVRW.js} +3 -3
- package/dist/to-hwpx-B7RPAOQC.cjs +16 -0
- package/dist/{to-hwpx-VBVI5H4N.cjs.map → to-hwpx-B7RPAOQC.cjs.map} +1 -1
- package/dist/{to-hwpx-OHZK2KBP.js → to-hwpx-BS2NFDUM.js} +4 -4
- package/dist/{to-hwpx-FR6GDNMY.js → to-hwpx-XFNMYMGR.js} +7 -7
- package/dist/visual-SECUV4LR.js +40 -0
- package/dist/{watch-OH4BMY2N.js → watch-ADXQOSZY.js} +23 -23
- package/package.json +1 -1
- package/dist/chunk-HHRQX733.cjs.map +0 -1
- package/dist/chunk-JYNG27VR.js.map +0 -1
- package/dist/chunk-MQ44UJN6.js.map +0 -1
- package/dist/chunk-PATC34WZ.js.map +0 -1
- package/dist/chunks-INR44FWQ.js +0 -11
- package/dist/generator-335G75L5.js +0 -11
- package/dist/generator-3S2MTXHO.cjs +0 -12
- package/dist/generator-R2CZZ2KU.js +0 -18
- package/dist/memo-SPNLGMIZ.js +0 -17
- package/dist/parser-NCSJG5KJ.cjs.map +0 -1
- package/dist/pdf-ocr-F3ABLLXD.cjs +0 -43
- package/dist/seal-XLDIGIIE.js +0 -16
- package/dist/to-hwpx-VBVI5H4N.cjs +0 -16
- package/dist/visual-IXMRTYJK.js +0 -40
- /package/dist/{-2LCJEMU4.js.map → -5UTN72IU.js.map} +0 -0
- /package/dist/{chunk-J6RLB6KE.js.map → chunk-4MAW3JZO.js.map} +0 -0
- /package/dist/{chunk-CWEB4XAH.js.map → chunk-5D25RVT5.js.map} +0 -0
- /package/dist/{chunk-E2RQPNXX.js.map → chunk-5TM34VJ5.js.map} +0 -0
- /package/dist/{chunk-RNBBMRKF.js.map → chunk-5XWGKCPA.js.map} +0 -0
- /package/dist/{chunk-PE3XRCTM.js.map → chunk-67WGWE23.js.map} +0 -0
- /package/dist/{chunk-T7YHAP4A.js.map → chunk-6P3XVII7.js.map} +0 -0
- /package/dist/{chunk-DTKVCSRC.js.map → chunk-7AWQXTSU.js.map} +0 -0
- /package/dist/{chunk-2ZQUSUDC.js.map → chunk-7Y2RNRWL.js.map} +0 -0
- /package/dist/{chunk-IRCO55NY.js.map → chunk-A7VTEP5R.js.map} +0 -0
- /package/dist/{chunk-TGM5V7UD.js.map → chunk-AMSLIVAC.js.map} +0 -0
- /package/dist/{chunk-MHDVZBUV.js.map → chunk-AOBRIYGM.js.map} +0 -0
- /package/dist/{chunk-MRHLGVK5.js.map → chunk-BPMDM3JP.js.map} +0 -0
- /package/dist/{chunk-PJ32UFPA.js.map → chunk-CG4BCYQ2.js.map} +0 -0
- /package/dist/{chunk-2P5GYSEI.js.map → chunk-CNUWB5NK.js.map} +0 -0
- /package/dist/{chunk-QDETIVPA.js.map → chunk-D4XGVKQV.js.map} +0 -0
- /package/dist/{chunk-ODJRLTXE.js.map → chunk-EFLSK5JD.js.map} +0 -0
- /package/dist/{chunk-4L3SF7EF.js.map → chunk-ERMTVALW.js.map} +0 -0
- /package/dist/{chunk-V3MVGLWO.js.map → chunk-GCUP3CBW.js.map} +0 -0
- /package/dist/{chunk-ZWA3MWAE.js.map → chunk-GUTZU7XE.js.map} +0 -0
- /package/dist/{chunk-BUZLNJXB.js.map → chunk-H7HRVW32.js.map} +0 -0
- /package/dist/{chunk-SABDVSQU.js.map → chunk-K6YLVT6X.js.map} +0 -0
- /package/dist/{chunk-SQ7BI34M.js.map → chunk-OLO76CMN.js.map} +0 -0
- /package/dist/{chunk-XIUXBJHE.js.map → chunk-P6GTNKAA.js.map} +0 -0
- /package/dist/{chunk-RZXJFM3A.js.map → chunk-QJ7MMZUI.js.map} +0 -0
- /package/dist/{chunk-LFXIZHPE.js.map → chunk-QWK3DGUI.js.map} +0 -0
- /package/dist/{chunk-U7EJ6QY7.js.map → chunk-SAUEKG7G.js.map} +0 -0
- /package/dist/{chunk-XOC5PVAC.js.map → chunk-SKP4XXCB.js.map} +0 -0
- /package/dist/{chunk-JT54JHR3.js.map → chunk-T424VUF7.js.map} +0 -0
- /package/dist/{chunk-45AT4XJD.js.map → chunk-UFTF2BO7.js.map} +0 -0
- /package/dist/{chunk-ODQJEBCB.js.map → chunk-UN3YZZNT.js.map} +0 -0
- /package/dist/{chunk-HQXVNLH2.js.map → chunk-XY5BFX3H.js.map} +0 -0
- /package/dist/{chunk-3X3ETOLW.js.map → chunk-Y2RWVFGG.js.map} +0 -0
- /package/dist/{chunk-WTKISVEW.js.map → chunk-YSOXWADD.js.map} +0 -0
- /package/dist/{chunk-4RB5OPUZ.js.map → chunk-ZZNZGQRX.js.map} +0 -0
- /package/dist/{chunks-INR44FWQ.js.map → chunks-QN364YXU.js.map} +0 -0
- /package/dist/{formula-3RUSZL2X.js.map → formula-37OIV2H3.js.map} +0 -0
- /package/dist/{formula-UJKRUT4H.js.map → formula-P6EJMUKF.js.map} +0 -0
- /package/dist/{generator-335G75L5.js.map → generator-C5FWPI6A.js.map} +0 -0
- /package/dist/{generator-R2CZZ2KU.js.map → generator-JX3OZYTO.js.map} +0 -0
- /package/dist/{hancom-VLS77NRS.js.map → hancom-547ZXYYE.js.map} +0 -0
- /package/dist/{hancom-4LFQU2RS.js.map → hancom-GOOSRL7W.js.map} +0 -0
- /package/dist/{image-ocr-CCLUXSWY.js.map → image-ocr-6HQTBMLN.js.map} +0 -0
- /package/dist/{image-ocr-B7RRK43I.js.map → image-ocr-RNY2H3HS.js.map} +0 -0
- /package/dist/{memo-SPNLGMIZ.js.map → memo-RE3TCSXK.js.map} +0 -0
- /package/dist/{model-bundle-KFPWVEFB.js.map → model-bundle-ZYGK4G65.js.map} +0 -0
- /package/dist/{models-IOX5WK67.js.map → models-K65TUK4Q.js.map} +0 -0
- /package/dist/{parse-worker-v2-IL6U65X3.js.map → parse-worker-v2-VOM4DPZV.js.map} +0 -0
- /package/dist/{pdf-ocr-7IH7FGKQ.js.map → pdf-ocr-2JDCK34V.js.map} +0 -0
- /package/dist/{pdf-ocr-ZUGHKM32.js.map → pdf-ocr-JNCOGFLO.js.map} +0 -0
- /package/dist/{profile-io-BGUQJDGK.js.map → profile-io-WHUZPJEM.js.map} +0 -0
- /package/dist/{rasterize-JOAG2QCQ.js.map → rasterize-XR5V2FQQ.js.map} +0 -0
- /package/dist/{redact-doc-WL2GWBMN.js.map → redact-doc-5FMV7KOY.js.map} +0 -0
- /package/dist/{render-672D354C.js.map → render-OKC4QJUY.js.map} +0 -0
- /package/dist/{rewrite-fallback-2JAAIU6G.js.map → rewrite-fallback-Y6ZUV6GG.js.map} +0 -0
- /package/dist/{seal-XLDIGIIE.js.map → seal-VMMMFVLG.js.map} +0 -0
- /package/dist/{setup-L4PVFG65.js.map → setup-Q6CIDVRW.js.map} +0 -0
- /package/dist/{to-hwpx-FR6GDNMY.js.map → to-hwpx-BS2NFDUM.js.map} +0 -0
- /package/dist/{to-hwpx-OHZK2KBP.js.map → to-hwpx-XFNMYMGR.js.map} +0 -0
- /package/dist/{visual-IXMRTYJK.js.map → visual-SECUV4LR.js.map} +0 -0
- /package/dist/{watch-OH4BMY2N.js.map → watch-ADXQOSZY.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -48,13 +48,13 @@ import {
|
|
|
48
48
|
readRecords,
|
|
49
49
|
resolveImageBlocks,
|
|
50
50
|
unfilledClickHereGuide
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-5D25RVT5.js";
|
|
52
52
|
import {
|
|
53
53
|
blocksToPages,
|
|
54
54
|
dropBlankImages,
|
|
55
55
|
readImageQrCodes,
|
|
56
56
|
wmfBitmap
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-YSOXWADD.js";
|
|
58
58
|
import {
|
|
59
59
|
parsePageRange
|
|
60
60
|
} from "./chunk-V4BH5SRQ.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
hasLibheif,
|
|
64
64
|
heicToRgba,
|
|
65
65
|
pcxToRgba
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-UN3YZZNT.js";
|
|
67
67
|
import {
|
|
68
68
|
WEBP_OPTIONS,
|
|
69
69
|
flushHeifCache,
|
|
@@ -247,7 +247,7 @@ import {
|
|
|
247
247
|
unescapeGfmCell,
|
|
248
248
|
warnInto,
|
|
249
249
|
wordHunks
|
|
250
|
-
} from "./chunk-
|
|
250
|
+
} from "./chunk-SAUEKG7G.js";
|
|
251
251
|
import {
|
|
252
252
|
hwpEquationToLatex
|
|
253
253
|
} from "./chunk-MXAZLFEA.js";
|
|
@@ -277,7 +277,7 @@ import {
|
|
|
277
277
|
tidyScriptTags,
|
|
278
278
|
unframeLayoutTables,
|
|
279
279
|
wrapScript
|
|
280
|
-
} from "./chunk-
|
|
280
|
+
} from "./chunk-P6GTNKAA.js";
|
|
281
281
|
import {
|
|
282
282
|
BARE_URL,
|
|
283
283
|
KordocError,
|
|
@@ -298,7 +298,7 @@ import {
|
|
|
298
298
|
toArrayBuffer,
|
|
299
299
|
unescapeHtml,
|
|
300
300
|
unzipLimitBytes
|
|
301
|
-
} from "./chunk-
|
|
301
|
+
} from "./chunk-T424VUF7.js";
|
|
302
302
|
|
|
303
303
|
// src/plain-markdown.ts
|
|
304
304
|
function toPlainMarkdown(md2) {
|
|
@@ -17924,7 +17924,7 @@ var MIN_SIDE = 24;
|
|
|
17924
17924
|
async function ocrEmbeddedImages(blocks, options, warnings) {
|
|
17925
17925
|
const ocr = options?.ocr;
|
|
17926
17926
|
if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
|
|
17927
|
-
const { parseImageDocument } = await import("./image-ocr-
|
|
17927
|
+
const { parseImageDocument } = await import("./image-ocr-RNY2H3HS.js");
|
|
17928
17928
|
let inserted = false, unreadable = 0;
|
|
17929
17929
|
let failed = null;
|
|
17930
17930
|
const walk = async (list, depth) => {
|
|
@@ -31483,6 +31483,12 @@ function latexToPlain(latex) {
|
|
|
31483
31483
|
const a = arg(), b = arg();
|
|
31484
31484
|
return `${wrap(a.trim())}/${wrap(b.trim())}`;
|
|
31485
31485
|
}
|
|
31486
|
+
if (name === "begin") {
|
|
31487
|
+
const env = arg().trim(), end = s.indexOf(`\\end{${env}}`, i), body = s.slice(i, end < 0 ? s.length : end);
|
|
31488
|
+
i = end < 0 ? s.length : end + env.length + 6;
|
|
31489
|
+
const rows = body.split(/\\\\/).map((r) => latexToPlain(r.replace(/&/g, "\\ "))).filter(Boolean);
|
|
31490
|
+
return (env === "cases" ? "{" : "") + rows.join("; ");
|
|
31491
|
+
}
|
|
31486
31492
|
if (name === "sqrt") {
|
|
31487
31493
|
skipWs();
|
|
31488
31494
|
let root = "";
|
|
@@ -31531,6 +31537,83 @@ function latexToPlain(latex) {
|
|
|
31531
31537
|
return seq("\0").replace(/\s+/g, " ").trim();
|
|
31532
31538
|
}
|
|
31533
31539
|
|
|
31540
|
+
// src/render/equation-layout.ts
|
|
31541
|
+
function textWidth(s) {
|
|
31542
|
+
let w = 0;
|
|
31543
|
+
for (const c of s) {
|
|
31544
|
+
if (/[0-9]/.test(c)) w += 0.5;
|
|
31545
|
+
else if (/[a-z]/.test(c)) w += 0.55;
|
|
31546
|
+
else if (/[A-Z]/.test(c)) w += 0.68;
|
|
31547
|
+
else if (/[가-힣]/.test(c)) w += 1;
|
|
31548
|
+
else if (/[+\-−]/.test(c)) w += 0.85;
|
|
31549
|
+
else if (/[=<>≤≥≠]/.test(c)) w += 0.95;
|
|
31550
|
+
else if (/[()[\]|]/.test(c)) w += 0.38;
|
|
31551
|
+
else if (/[,.:;'′]/.test(c)) w += 0.32;
|
|
31552
|
+
else if (c === " ") w += 0.25;
|
|
31553
|
+
else if (/[̀-ͯ⃐-]/.test(c)) w += 0;
|
|
31554
|
+
else w += 0.8;
|
|
31555
|
+
}
|
|
31556
|
+
return w;
|
|
31557
|
+
}
|
|
31558
|
+
function argAt(s, i) {
|
|
31559
|
+
while (s[i] === " ") i++;
|
|
31560
|
+
if (s[i] === "{") {
|
|
31561
|
+
for (let d = 0, k = i; k < s.length; k++) {
|
|
31562
|
+
if (s[k] === "\\") {
|
|
31563
|
+
k++;
|
|
31564
|
+
continue;
|
|
31565
|
+
}
|
|
31566
|
+
if (s[k] === "{") d++;
|
|
31567
|
+
else if (s[k] === "}" && --d === 0) return [s.slice(i + 1, k), k + 1];
|
|
31568
|
+
}
|
|
31569
|
+
return [s.slice(i + 1), s.length];
|
|
31570
|
+
}
|
|
31571
|
+
if (s[i] === "\\") {
|
|
31572
|
+
let k = i + 1;
|
|
31573
|
+
while (/[A-Za-z]/.test(s[k] ?? "")) k++;
|
|
31574
|
+
return [s.slice(i, Math.max(k, i + 2)), Math.max(k, i + 2)];
|
|
31575
|
+
}
|
|
31576
|
+
return [s[i] ?? "", i + 1];
|
|
31577
|
+
}
|
|
31578
|
+
function layoutFractions(latex) {
|
|
31579
|
+
if (/\\\\|\\begin\{/.test(latex)) return null;
|
|
31580
|
+
const ops = [];
|
|
31581
|
+
let x = 0, a = 0.86, d = 0.14, depth = 0, plain3 = "", found = false;
|
|
31582
|
+
const flush = () => {
|
|
31583
|
+
const t = latexToPlain(plain3);
|
|
31584
|
+
plain3 = "";
|
|
31585
|
+
if (!t) return;
|
|
31586
|
+
ops.push({ x, y: 0, text: t });
|
|
31587
|
+
x += textWidth(t);
|
|
31588
|
+
};
|
|
31589
|
+
for (let i = 0; i < latex.length; ) {
|
|
31590
|
+
if (depth === 0 && latex.startsWith("\\frac", i) && !/[A-Za-z]/.test(latex[i + 5] ?? "")) {
|
|
31591
|
+
flush();
|
|
31592
|
+
const [num4, j] = argAt(latex, i + 5), [den, k] = argAt(latex, j);
|
|
31593
|
+
const n = latexToPlain(num4), m = latexToPlain(den), nw = textWidth(n), mw = textWidth(m), w = Math.max(nw, mw) + 0.25;
|
|
31594
|
+
ops.push({ x: x + (w - nw) / 2, y: 0.66, text: n }, { x: x + (w - mw) / 2, y: -0.64, text: m }, { x: x + 0.06, y: 0.37, rule: w - 0.12 });
|
|
31595
|
+
x += w;
|
|
31596
|
+
a = Math.max(a, 1.52);
|
|
31597
|
+
d = Math.max(d, 0.78);
|
|
31598
|
+
found = true;
|
|
31599
|
+
i = k;
|
|
31600
|
+
continue;
|
|
31601
|
+
}
|
|
31602
|
+
const c = latex[i];
|
|
31603
|
+
if (c === "\\") {
|
|
31604
|
+
plain3 += latex.slice(i, i + 2);
|
|
31605
|
+
i += 2;
|
|
31606
|
+
continue;
|
|
31607
|
+
}
|
|
31608
|
+
if (c === "{") depth++;
|
|
31609
|
+
else if (c === "}") depth--;
|
|
31610
|
+
plain3 += c;
|
|
31611
|
+
i++;
|
|
31612
|
+
}
|
|
31613
|
+
flush();
|
|
31614
|
+
return found ? { w: x, a, d, ops } : null;
|
|
31615
|
+
}
|
|
31616
|
+
|
|
31534
31617
|
// src/render/svg-content.ts
|
|
31535
31618
|
function escapeXml(s) {
|
|
31536
31619
|
return s.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g, "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -32039,8 +32122,24 @@ function drawObject(o, x, y, baseV, areaW, ctx, depth) {
|
|
|
32039
32122
|
}
|
|
32040
32123
|
} else if (o.tag === "equation") {
|
|
32041
32124
|
const script = findChildByLocalName(o.el, "script")?.textContent ?? "";
|
|
32042
|
-
const
|
|
32043
|
-
|
|
32125
|
+
const latex = script ? hwpEquationToLatex(script) : "";
|
|
32126
|
+
const text = latex ? latexToPlain(latex) : "";
|
|
32127
|
+
const frac = text && o.width > 0 && o.height > 0 ? layoutFractions(latex) : null;
|
|
32128
|
+
if (frac) {
|
|
32129
|
+
const bl = Number(o.el.getAttribute("baseLine")), size = num2(o.el, "baseUnit", 1e3);
|
|
32130
|
+
const k = Math.min(o.width / (frac.w * size), o.height / ((frac.a + frac.d) * size)), em = size * Math.max(0.5, Math.min(1.5, k));
|
|
32131
|
+
const by = y + Math.round(o.height * (Number.isFinite(bl) && bl > 0 ? bl / 100 : frac.a / (frac.a + frac.d)));
|
|
32132
|
+
const x0 = x + Math.max(0, (o.width - frac.w * em) / 2);
|
|
32133
|
+
const color = o.el.getAttribute("textColor"), fill = color && color !== "#000000" ? escapeXml(color) : null;
|
|
32134
|
+
for (const op of frac.ops) {
|
|
32135
|
+
const ox = x0 + op.x * em, oy = by - op.y * em;
|
|
32136
|
+
if (op.rule) emit(ctx, `<line x1="${pt2(ox)}" y1="${pt2(oy)}" x2="${pt2(ox + op.rule * em)}" y2="${pt2(oy)}" stroke="${fill ?? "#000"}" stroke-width="${pt2(em * 0.05)}"/>`);
|
|
32137
|
+
else if (op.text) {
|
|
32138
|
+
emit(ctx, `<text x="${pt2(ox)}" y="${pt2(oy)}" font-size="${pt2(em)}" font-family="'Times New Roman','HCR Batang','Noto Serif KR',serif"${fill ? ` fill="${fill}"` : ""}>${escapeXml(op.text)}</text>`);
|
|
32139
|
+
ctx.stats.texts++;
|
|
32140
|
+
}
|
|
32141
|
+
}
|
|
32142
|
+
} else if (text && o.width > 0) {
|
|
32044
32143
|
const bl = Number(o.el.getAttribute("baseLine")), size = num2(o.el, "baseUnit", 1e3);
|
|
32045
32144
|
const by = y + Math.round(o.height * (Number.isFinite(bl) && bl > 0 ? bl / 100 : 0.85));
|
|
32046
32145
|
const color = o.el.getAttribute("textColor");
|
|
@@ -34087,7 +34186,7 @@ var MAX_MULTIPAGE_PIXELS = 1e9;
|
|
|
34087
34186
|
var MIN_PAGE_PIXELS = 1e6;
|
|
34088
34187
|
async function parseImage(buffer, options) {
|
|
34089
34188
|
try {
|
|
34090
|
-
const { parseImageDocument, imagePageCount, imagePage, imagePagePixels } = await import("./image-ocr-
|
|
34189
|
+
const { parseImageDocument, imagePageCount, imagePage, imagePagePixels } = await import("./image-ocr-RNY2H3HS.js");
|
|
34091
34190
|
const pageCount = await imagePageCount(buffer);
|
|
34092
34191
|
const wanted = pageCount > 1 && options?.pages ? parsePageRange(options.pages, pageCount) : null;
|
|
34093
34192
|
const blocks = [], warnings = [], lines = [], images = [];
|
|
@@ -34184,7 +34283,7 @@ async function parseHwp(buffer, options) {
|
|
|
34184
34283
|
async function parsePdf(buffer, options) {
|
|
34185
34284
|
let parsePdfDocument;
|
|
34186
34285
|
try {
|
|
34187
|
-
const mod = await import("./parser-
|
|
34286
|
+
const mod = await import("./parser-SNW4ZFUX.js");
|
|
34188
34287
|
parsePdfDocument = mod.parsePdfDocument;
|
|
34189
34288
|
} catch {
|
|
34190
34289
|
return {
|
|
@@ -34266,7 +34365,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
34266
34365
|
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})`);
|
|
34267
34366
|
}
|
|
34268
34367
|
} else if (format2 === "hwp" && detectOle2Format(buffer) === "hwp") {
|
|
34269
|
-
const { hwpToHwpx: hwpToHwpx2 } = await import("./to-hwpx-
|
|
34368
|
+
const { hwpToHwpx: hwpToHwpx2 } = await import("./to-hwpx-BS2NFDUM.js");
|
|
34270
34369
|
const hwpx = await hwpToHwpx2(new Uint8Array(buffer));
|
|
34271
34370
|
buffer = hwpx.buffer.slice(hwpx.byteOffset, hwpx.byteOffset + hwpx.byteLength);
|
|
34272
34371
|
} else {
|