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.
@@ -1,5 +1,5 @@
1
1
  // src/utils.ts
2
- var VERSION = true ? "2.5.1" : "0.0.0-dev";
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-OCVWJSG7.js.map
450
+ //# sourceMappingURL=chunk-24NKFRB4.js.map
@@ -20,7 +20,7 @@ import {
20
20
  sanitizeHref,
21
21
  stripDtd,
22
22
  toArrayBuffer
23
- } from "./chunk-KO7DKAXW.js";
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="${fontId}" latin="${fontId}" hanja="${fontId}" japanese="${fontId}" other="${fontId}" symbol="${fontId}" user="${fontId}"/>
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="2">
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="2">
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.1mm" color="#000000"/>
3599
- <hh:rightBorder type="NONE" width="0.1mm" color="#000000"/>
3600
- <hh:topBorder type="NONE" width="0.1mm" color="#000000"/>
3601
- <hh:bottomBorder type="NONE" width="0.1mm" color="#000000"/>
3602
- <hh:diagonal type="NONE" width="0.1mm" color="#000000"/>
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.12mm" color="#000000"/>
3609
- <hh:rightBorder type="SOLID" width="0.12mm" color="#000000"/>
3610
- <hh:topBorder type="SOLID" width="0.12mm" color="#000000"/>
3611
- <hh:bottomBorder type="SOLID" width="0.12mm" color="#000000"/>
3612
- <hh:diagonal type="NONE" width="0.1mm" color="#000000"/>
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 marker = block.ordered ? `${(block.indent || 0) + 1}. ` : "\xB7 ";
3701
- const indentPrefix = " ".repeat(block.indent || 0);
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-DA3CGOZF.js");
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-QEZ4CUF7.js.map
5052
+ //# sourceMappingURL=chunk-2CAJSQK5.js.map