kordoc 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-OCVWJSG7.js → chunk-24NKFRB4.js} +2 -2
- package/dist/{chunk-QEZ4CUF7.js → chunk-2CAJSQK5.js} +48 -18
- package/dist/chunk-2CAJSQK5.js.map +1 -0
- package/dist/{chunk-KO7DKAXW.js → chunk-NKKLA43G.js} +2 -2
- package/dist/{chunk-TTSFPEDM.cjs → chunk-Z65OQP3H.cjs} +2 -2
- package/dist/{chunk-TTSFPEDM.cjs.map → chunk-Z65OQP3H.cjs.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/index.cjs +129 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +47 -17
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +3 -3
- package/dist/{parser-BOIVVDYI.cjs → parser-AZYPOKAR.cjs} +15 -15
- package/dist/{parser-BOIVVDYI.cjs.map → parser-AZYPOKAR.cjs.map} +1 -1
- package/dist/{parser-NZFDRZLS.js → parser-BQKQOIJU.js} +2 -2
- package/dist/{parser-DA3CGOZF.js → parser-FRROKAB7.js} +2 -2
- package/dist/{watch-HWN6Y6Q2.js → watch-ZJAUWUAE.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-QEZ4CUF7.js.map +0 -1
- /package/dist/{chunk-OCVWJSG7.js.map → chunk-24NKFRB4.js.map} +0 -0
- /package/dist/{chunk-KO7DKAXW.js.map → chunk-NKKLA43G.js.map} +0 -0
- /package/dist/{parser-NZFDRZLS.js.map → parser-BQKQOIJU.js.map} +0 -0
- /package/dist/{parser-DA3CGOZF.js.map → parser-FRROKAB7.js.map} +0 -0
- /package/dist/{watch-HWN6Y6Q2.js.map → watch-ZJAUWUAE.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/utils.ts
|
|
2
|
-
var VERSION = true ? "2.5.
|
|
2
|
+
var VERSION = true ? "2.5.2" : "0.0.0-dev";
|
|
3
3
|
function toArrayBuffer(buf) {
|
|
4
4
|
if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
|
|
5
5
|
return buf.buffer;
|
|
@@ -447,4 +447,4 @@ export {
|
|
|
447
447
|
HEADING_RATIO_H2,
|
|
448
448
|
HEADING_RATIO_H3
|
|
449
449
|
};
|
|
450
|
-
//# sourceMappingURL=chunk-
|
|
450
|
+
//# sourceMappingURL=chunk-24NKFRB4.js.map
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
sanitizeHref,
|
|
21
21
|
stripDtd,
|
|
22
22
|
toArrayBuffer
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-NKKLA43G.js";
|
|
24
24
|
import {
|
|
25
25
|
parsePageRange
|
|
26
26
|
} from "./chunk-MOL7MDBG.js";
|
|
@@ -3523,8 +3523,9 @@ function generateManifest() {
|
|
|
3523
3523
|
function charPr(id, height, bold, italic, fontId = 0) {
|
|
3524
3524
|
const boldAttr = bold ? ` bold="1"` : "";
|
|
3525
3525
|
const italicAttr = italic ? ` italic="1"` : "";
|
|
3526
|
+
const effFont = bold ? 2 : fontId;
|
|
3526
3527
|
return ` <hh:charPr id="${id}" height="${height}" textColor="#000000" shadeColor="none" useFontSpace="0" useKerning="0" symMark="NONE" borderFillIDRef="0"${boldAttr}${italicAttr}>
|
|
3527
|
-
<hh:fontRef hangul="${
|
|
3528
|
+
<hh:fontRef hangul="${effFont}" latin="${effFont}" hanja="${effFont}" japanese="${effFont}" other="${effFont}" symbol="${effFont}" user="${effFont}"/>
|
|
3528
3529
|
<hh:ratio hangul="100" latin="100" hanja="100" japanese="100" other="100" symbol="100" user="100"/>
|
|
3529
3530
|
<hh:spacing hangul="0" latin="0" hanja="0" japanese="0" other="0" symbol="0" user="0"/>
|
|
3530
3531
|
<hh:relSz hangul="100" latin="100" hanja="100" japanese="100" other="100" symbol="100" user="100"/>
|
|
@@ -3549,21 +3550,27 @@ function generateHeaderXml() {
|
|
|
3549
3550
|
<hh:beginNum page="1" footnote="1" endnote="1" pic="1" tbl="1" equation="1"/>
|
|
3550
3551
|
<hh:refList>
|
|
3551
3552
|
<hh:fontfaces itemCnt="7">
|
|
3552
|
-
<hh:fontface lang="HANGUL" fontCnt="
|
|
3553
|
+
<hh:fontface lang="HANGUL" fontCnt="3">
|
|
3553
3554
|
<hh:font id="0" face="\uD568\uCD08\uB86C\uBC14\uD0D5" type="TTF" isEmbedded="0">
|
|
3554
3555
|
<hh:typeInfo familyType="FCAT_GOTHIC" weight="6" proportion="4" contrast="0" strokeVariation="1" armStyle="1" letterform="1" midline="1" xHeight="1"/>
|
|
3555
3556
|
</hh:font>
|
|
3556
3557
|
<hh:font id="1" face="\uD568\uCD08\uB86C\uB3CB\uC6C0" type="TTF" isEmbedded="0">
|
|
3557
3558
|
<hh:typeInfo familyType="FCAT_GOTHIC" weight="6" proportion="4" contrast="0" strokeVariation="1" armStyle="1" letterform="1" midline="1" xHeight="1"/>
|
|
3558
3559
|
</hh:font>
|
|
3560
|
+
<hh:font id="2" face="HY\uACAC\uACE0\uB515" type="TTF" isEmbedded="0">
|
|
3561
|
+
<hh:typeInfo familyType="FCAT_GOTHIC" weight="9" proportion="0" contrast="0" strokeVariation="1" armStyle="1" letterform="1" midline="1" xHeight="1"/>
|
|
3562
|
+
</hh:font>
|
|
3559
3563
|
</hh:fontface>
|
|
3560
|
-
<hh:fontface lang="LATIN" fontCnt="
|
|
3564
|
+
<hh:fontface lang="LATIN" fontCnt="3">
|
|
3561
3565
|
<hh:font id="0" face="Times New Roman" type="TTF" isEmbedded="0">
|
|
3562
3566
|
<hh:typeInfo familyType="FCAT_OLDSTYLE" weight="5" proportion="4" contrast="2" strokeVariation="0" armStyle="0" letterform="0" midline="0" xHeight="4"/>
|
|
3563
3567
|
</hh:font>
|
|
3564
3568
|
<hh:font id="1" face="Consolas" type="TTF" isEmbedded="0">
|
|
3565
3569
|
<hh:typeInfo familyType="FCAT_MODERN" weight="5" proportion="0" contrast="0" strokeVariation="0" armStyle="0" letterform="0" midline="0" xHeight="0"/>
|
|
3566
3570
|
</hh:font>
|
|
3571
|
+
<hh:font id="2" face="Arial Black" type="TTF" isEmbedded="0">
|
|
3572
|
+
<hh:typeInfo familyType="FCAT_GOTHIC" weight="9" proportion="0" contrast="0" strokeVariation="0" armStyle="0" letterform="0" midline="0" xHeight="0"/>
|
|
3573
|
+
</hh:font>
|
|
3567
3574
|
</hh:fontface>
|
|
3568
3575
|
<hh:fontface lang="HANJA" fontCnt="1">
|
|
3569
3576
|
<hh:font id="0" face="\uD568\uCD08\uB86C\uBC14\uD0D5" type="TTF" isEmbedded="0">
|
|
@@ -3595,21 +3602,21 @@ function generateHeaderXml() {
|
|
|
3595
3602
|
<hh:borderFill id="0" threeD="0" shadow="0" centerLine="0" breakCellSeparateLine="0">
|
|
3596
3603
|
<hh:slash type="NONE" Crooked="0" isCounter="0"/>
|
|
3597
3604
|
<hh:backSlash type="NONE" Crooked="0" isCounter="0"/>
|
|
3598
|
-
<hh:leftBorder type="NONE" width="0.
|
|
3599
|
-
<hh:rightBorder type="NONE" width="0.
|
|
3600
|
-
<hh:topBorder type="NONE" width="0.
|
|
3601
|
-
<hh:bottomBorder type="NONE" width="0.
|
|
3602
|
-
<hh:diagonal type="NONE" width="0.
|
|
3605
|
+
<hh:leftBorder type="NONE" width="0.1 mm" color="#000000"/>
|
|
3606
|
+
<hh:rightBorder type="NONE" width="0.1 mm" color="#000000"/>
|
|
3607
|
+
<hh:topBorder type="NONE" width="0.1 mm" color="#000000"/>
|
|
3608
|
+
<hh:bottomBorder type="NONE" width="0.1 mm" color="#000000"/>
|
|
3609
|
+
<hh:diagonal type="NONE" width="0.1 mm" color="#000000"/>
|
|
3603
3610
|
<hh:fillInfo/>
|
|
3604
3611
|
</hh:borderFill>
|
|
3605
3612
|
<hh:borderFill id="1" threeD="0" shadow="0" centerLine="0" breakCellSeparateLine="0">
|
|
3606
3613
|
<hh:slash type="NONE" Crooked="0" isCounter="0"/>
|
|
3607
3614
|
<hh:backSlash type="NONE" Crooked="0" isCounter="0"/>
|
|
3608
|
-
<hh:leftBorder type="SOLID" width="0.
|
|
3609
|
-
<hh:rightBorder type="SOLID" width="0.
|
|
3610
|
-
<hh:topBorder type="SOLID" width="0.
|
|
3611
|
-
<hh:bottomBorder type="SOLID" width="0.
|
|
3612
|
-
<hh:diagonal type="NONE" width="0.
|
|
3615
|
+
<hh:leftBorder type="SOLID" width="0.12 mm" color="#000000"/>
|
|
3616
|
+
<hh:rightBorder type="SOLID" width="0.12 mm" color="#000000"/>
|
|
3617
|
+
<hh:topBorder type="SOLID" width="0.12 mm" color="#000000"/>
|
|
3618
|
+
<hh:bottomBorder type="SOLID" width="0.12 mm" color="#000000"/>
|
|
3619
|
+
<hh:diagonal type="NONE" width="0.1 mm" color="#000000"/>
|
|
3613
3620
|
<hh:fillInfo/>
|
|
3614
3621
|
</hh:borderFill>
|
|
3615
3622
|
</hh:borderFills>
|
|
@@ -3676,8 +3683,16 @@ function generateTable(rows) {
|
|
|
3676
3683
|
function blocksToSectionXml(blocks) {
|
|
3677
3684
|
const paraXmls = [];
|
|
3678
3685
|
let isFirst = true;
|
|
3686
|
+
const orderedCounters = {};
|
|
3687
|
+
let prevWasOrdered = false;
|
|
3679
3688
|
for (const block of blocks) {
|
|
3680
3689
|
let xml = "";
|
|
3690
|
+
if (block.type !== "list_item" || !block.ordered) {
|
|
3691
|
+
if (prevWasOrdered) {
|
|
3692
|
+
for (const k of Object.keys(orderedCounters)) delete orderedCounters[+k];
|
|
3693
|
+
}
|
|
3694
|
+
prevWasOrdered = false;
|
|
3695
|
+
}
|
|
3681
3696
|
switch (block.type) {
|
|
3682
3697
|
case "heading": {
|
|
3683
3698
|
const pId = headingParaPrId(block.level || 1);
|
|
@@ -3697,8 +3712,23 @@ function blocksToSectionXml(blocks) {
|
|
|
3697
3712
|
xml = generateParagraph(block.text || "", PARA_QUOTE);
|
|
3698
3713
|
break;
|
|
3699
3714
|
case "list_item": {
|
|
3700
|
-
const
|
|
3701
|
-
|
|
3715
|
+
const indent = block.indent || 0;
|
|
3716
|
+
let marker;
|
|
3717
|
+
if (block.ordered) {
|
|
3718
|
+
orderedCounters[indent] = (orderedCounters[indent] || 0) + 1;
|
|
3719
|
+
for (const k of Object.keys(orderedCounters)) {
|
|
3720
|
+
if (+k > indent) delete orderedCounters[+k];
|
|
3721
|
+
}
|
|
3722
|
+
marker = `${orderedCounters[indent]}. `;
|
|
3723
|
+
prevWasOrdered = true;
|
|
3724
|
+
} else {
|
|
3725
|
+
marker = "\xB7 ";
|
|
3726
|
+
if (prevWasOrdered) {
|
|
3727
|
+
for (const k of Object.keys(orderedCounters)) delete orderedCounters[+k];
|
|
3728
|
+
}
|
|
3729
|
+
prevWasOrdered = false;
|
|
3730
|
+
}
|
|
3731
|
+
const indentPrefix = " ".repeat(indent);
|
|
3702
3732
|
xml = generateParagraph(indentPrefix + marker + (block.text || ""), PARA_LIST);
|
|
3703
3733
|
break;
|
|
3704
3734
|
}
|
|
@@ -4789,7 +4819,7 @@ async function parseHwp(buffer, options) {
|
|
|
4789
4819
|
async function parsePdf(buffer, options) {
|
|
4790
4820
|
let parsePdfDocument;
|
|
4791
4821
|
try {
|
|
4792
|
-
const mod = await import("./parser-
|
|
4822
|
+
const mod = await import("./parser-FRROKAB7.js");
|
|
4793
4823
|
parsePdfDocument = mod.parsePdfDocument;
|
|
4794
4824
|
} catch {
|
|
4795
4825
|
return {
|
|
@@ -5019,4 +5049,4 @@ export {
|
|
|
5019
5049
|
compare,
|
|
5020
5050
|
parse
|
|
5021
5051
|
};
|
|
5022
|
-
//# sourceMappingURL=chunk-
|
|
5052
|
+
//# sourceMappingURL=chunk-2CAJSQK5.js.map
|