kordoc 4.7.0 → 4.7.1

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.
Files changed (94) hide show
  1. package/dist/{-MK2223RL.js → -O42BMYNX.js} +9 -9
  2. package/dist/{chunk-GIWKBPII.js → chunk-3UIT4PPQ.js} +2 -2
  3. package/dist/{chunk-MVTX6ODZ.js → chunk-4VNUQYUE.js} +1 -1
  4. package/dist/chunk-4VNUQYUE.js.map +1 -0
  5. package/dist/{chunk-6PIR74EA.js → chunk-5KPNXBNR.js} +26 -14
  6. package/dist/chunk-5KPNXBNR.js.map +1 -0
  7. package/dist/{chunk-AEYNY6FG.js → chunk-6663UXPE.js} +2 -2
  8. package/dist/{chunk-AFPD74JJ.js → chunk-7ZIOZ6PU.js} +2 -2
  9. package/dist/{chunk-XZDJXYUC.js → chunk-AFX6ZXER.js} +2 -2
  10. package/dist/{chunk-PEVPKD6Z.js → chunk-BQENBAUC.js} +3 -3
  11. package/dist/{chunk-TUU535RB.cjs → chunk-DJKLOLBT.cjs} +2 -2
  12. package/dist/chunk-DJKLOLBT.cjs.map +1 -0
  13. package/dist/{chunk-BCG2PKQU.js → chunk-IMEMTJ76.js} +11 -5
  14. package/dist/chunk-IMEMTJ76.js.map +1 -0
  15. package/dist/{chunk-YUVKU5CW.js → chunk-IZEUWEEY.js} +2 -2
  16. package/dist/chunk-IZEUWEEY.js.map +1 -0
  17. package/dist/{chunk-ZYVULRYF.js → chunk-J3W6Q3AX.js} +2 -2
  18. package/dist/{chunk-PV2EXXGI.js → chunk-JEX5P66D.js} +3 -3
  19. package/dist/{chunk-P2NWNJMR.js → chunk-PLEGO474.js} +2 -2
  20. package/dist/{chunk-5QTHHQQE.cjs → chunk-TZ3WCAJZ.cjs} +3 -3
  21. package/dist/{chunk-5QTHHQQE.cjs.map → chunk-TZ3WCAJZ.cjs.map} +1 -1
  22. package/dist/{chunk-W5KRKBYR.cjs → chunk-USGC3ZKU.cjs} +13 -7
  23. package/dist/chunk-USGC3ZKU.cjs.map +1 -0
  24. package/dist/{chunk-YXXHH6WC.js → chunk-UZB3UGC5.js} +2 -2
  25. package/dist/{chunk-IDHBO6AG.js → chunk-VECVLIWE.js} +3 -3
  26. package/dist/{chunk-3VTMSSDW.js → chunk-YWDN5PQC.js} +11 -5
  27. package/dist/chunk-YWDN5PQC.js.map +1 -0
  28. package/dist/{chunk-C27PPXRZ.cjs → chunk-ZDWP3LLY.cjs} +10 -10
  29. package/dist/{chunk-C27PPXRZ.cjs.map → chunk-ZDWP3LLY.cjs.map} +1 -1
  30. package/dist/chunks-C7DJL4RE.js +10 -0
  31. package/dist/cli.js +17 -17
  32. package/dist/{image-ocr-4MHEX4MN.js → image-ocr-5QRZBNOF.js} +5 -5
  33. package/dist/{image-ocr-OB5PCQUU.cjs → image-ocr-MKD6MKWO.cjs} +10 -10
  34. package/dist/{image-ocr-OB5PCQUU.cjs.map → image-ocr-MKD6MKWO.cjs.map} +1 -1
  35. package/dist/{image-ocr-3A3HZX6O.js → image-ocr-TAJHRZ5T.js} +4 -4
  36. package/dist/index.cjs +479 -467
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +4 -0
  39. package/dist/index.d.ts +4 -0
  40. package/dist/index.js +21 -9
  41. package/dist/index.js.map +1 -1
  42. package/dist/mcp.js +15 -15
  43. package/dist/{parser-EQN4YKU4.js → parser-RCEHB2EV.js} +49 -6
  44. package/dist/parser-RCEHB2EV.js.map +1 -0
  45. package/dist/{parser-VACM3DFR.cjs → parser-SWY4RKGD.cjs} +69 -26
  46. package/dist/parser-SWY4RKGD.cjs.map +1 -0
  47. package/dist/{parser-EIVCD4NS.js → parser-UMFBJG2D.js} +50 -7
  48. package/dist/parser-UMFBJG2D.js.map +1 -0
  49. package/dist/pdf-ocr-3NTV3MYP.js +12 -0
  50. package/dist/{pdf-ocr-NPYDUIC5.js → pdf-ocr-7BOO4JA7.js} +5 -5
  51. package/dist/pdf-ocr-JDHELYBY.cjs +13 -0
  52. package/dist/{pdf-ocr-OBPQ4F4D.cjs.map → pdf-ocr-JDHELYBY.cjs.map} +1 -1
  53. package/dist/{profile-io-L5EH4JAD.js → profile-io-HT62OAEU.js} +3 -3
  54. package/dist/{rasterize-7AR662AL.js → rasterize-GL67HQC7.js} +2 -2
  55. package/dist/render-IQ4IZLY4.js +10 -0
  56. package/dist/seal-AGSZ6MUR.js +10 -0
  57. package/dist/{watch-MONT6CGI.js → watch-5ST75Q7Q.js} +9 -9
  58. package/package.json +1 -1
  59. package/dist/chunk-3VTMSSDW.js.map +0 -1
  60. package/dist/chunk-6PIR74EA.js.map +0 -1
  61. package/dist/chunk-BCG2PKQU.js.map +0 -1
  62. package/dist/chunk-MVTX6ODZ.js.map +0 -1
  63. package/dist/chunk-TUU535RB.cjs.map +0 -1
  64. package/dist/chunk-W5KRKBYR.cjs.map +0 -1
  65. package/dist/chunk-YUVKU5CW.js.map +0 -1
  66. package/dist/chunks-4HEG6ZPG.js +0 -10
  67. package/dist/parser-EIVCD4NS.js.map +0 -1
  68. package/dist/parser-EQN4YKU4.js.map +0 -1
  69. package/dist/parser-VACM3DFR.cjs.map +0 -1
  70. package/dist/pdf-ocr-N62EWEX4.js +0 -12
  71. package/dist/pdf-ocr-OBPQ4F4D.cjs +0 -13
  72. package/dist/render-CAFQT7S4.js +0 -10
  73. package/dist/seal-ESAC3IZR.js +0 -10
  74. /package/dist/{-MK2223RL.js.map → -O42BMYNX.js.map} +0 -0
  75. /package/dist/{chunk-GIWKBPII.js.map → chunk-3UIT4PPQ.js.map} +0 -0
  76. /package/dist/{chunk-AEYNY6FG.js.map → chunk-6663UXPE.js.map} +0 -0
  77. /package/dist/{chunk-AFPD74JJ.js.map → chunk-7ZIOZ6PU.js.map} +0 -0
  78. /package/dist/{chunk-XZDJXYUC.js.map → chunk-AFX6ZXER.js.map} +0 -0
  79. /package/dist/{chunk-PEVPKD6Z.js.map → chunk-BQENBAUC.js.map} +0 -0
  80. /package/dist/{chunk-ZYVULRYF.js.map → chunk-J3W6Q3AX.js.map} +0 -0
  81. /package/dist/{chunk-PV2EXXGI.js.map → chunk-JEX5P66D.js.map} +0 -0
  82. /package/dist/{chunk-P2NWNJMR.js.map → chunk-PLEGO474.js.map} +0 -0
  83. /package/dist/{chunk-YXXHH6WC.js.map → chunk-UZB3UGC5.js.map} +0 -0
  84. /package/dist/{chunk-IDHBO6AG.js.map → chunk-VECVLIWE.js.map} +0 -0
  85. /package/dist/{chunks-4HEG6ZPG.js.map → chunks-C7DJL4RE.js.map} +0 -0
  86. /package/dist/{image-ocr-4MHEX4MN.js.map → image-ocr-5QRZBNOF.js.map} +0 -0
  87. /package/dist/{image-ocr-3A3HZX6O.js.map → image-ocr-TAJHRZ5T.js.map} +0 -0
  88. /package/dist/{pdf-ocr-N62EWEX4.js.map → pdf-ocr-3NTV3MYP.js.map} +0 -0
  89. /package/dist/{pdf-ocr-NPYDUIC5.js.map → pdf-ocr-7BOO4JA7.js.map} +0 -0
  90. /package/dist/{profile-io-L5EH4JAD.js.map → profile-io-HT62OAEU.js.map} +0 -0
  91. /package/dist/{rasterize-7AR662AL.js.map → rasterize-GL67HQC7.js.map} +0 -0
  92. /package/dist/{render-CAFQT7S4.js.map → render-IQ4IZLY4.js.map} +0 -0
  93. /package/dist/{seal-ESAC3IZR.js.map → seal-AGSZ6MUR.js.map} +0 -0
  94. /package/dist/{watch-MONT6CGI.js.map → watch-5ST75Q7Q.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -16,6 +16,8 @@ interface IRSpan {
16
16
  bold?: boolean;
17
17
  italic?: boolean;
18
18
  strike?: boolean;
19
+ /** 밑줄 — 개정문 추가·변경 표시 등. GFM 문법이 없어 <u>…</u> 인라인 HTML 로 방출 */
20
+ underline?: boolean;
19
21
  code?: boolean;
20
22
  }
21
23
  interface IRBlock {
@@ -81,6 +83,8 @@ interface InlineStyle {
81
83
  italic?: boolean;
82
84
  /** 취소선 — 법령 개정문 등의 삭제 표시. 판정은 취소선 모양 whitelist (비트만 믿으면 오탐) */
83
85
  strike?: boolean;
86
+ /** 밑줄 — 판정은 밑줄 종류 BOTTOM 한정 (NONE 이 기본 잡음, 코퍼스 실측) */
87
+ underline?: boolean;
84
88
  fontSize?: number;
85
89
  fontName?: string;
86
90
  }
package/dist/index.d.ts CHANGED
@@ -16,6 +16,8 @@ interface IRSpan {
16
16
  bold?: boolean;
17
17
  italic?: boolean;
18
18
  strike?: boolean;
19
+ /** 밑줄 — 개정문 추가·변경 표시 등. GFM 문법이 없어 <u>…</u> 인라인 HTML 로 방출 */
20
+ underline?: boolean;
19
21
  code?: boolean;
20
22
  }
21
23
  interface IRBlock {
@@ -81,6 +83,8 @@ interface InlineStyle {
81
83
  italic?: boolean;
82
84
  /** 취소선 — 법령 개정문 등의 삭제 표시. 판정은 취소선 모양 whitelist (비트만 믿으면 오탐) */
83
85
  strike?: boolean;
86
+ /** 밑줄 — 판정은 밑줄 종류 BOTTOM 한정 (NONE 이 기본 잡음, 코퍼스 실측) */
87
+ underline?: boolean;
84
88
  fontSize?: number;
85
89
  fontName?: string;
86
90
  }
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  flattenLayoutTables,
9
9
  inlineImagesIntoMarkdown,
10
10
  mapPuaText
11
- } from "./chunk-BCG2PKQU.js";
11
+ } from "./chunk-IMEMTJ76.js";
12
12
  import {
13
13
  parsePageRange
14
14
  } from "./chunk-GE43BE46.js";
@@ -27,7 +27,7 @@ import {
27
27
  sanitizeHref,
28
28
  stripDtd,
29
29
  toArrayBuffer
30
- } from "./chunk-YUVKU5CW.js";
30
+ } from "./chunk-IZEUWEEY.js";
31
31
 
32
32
  // src/index.ts
33
33
  import { readFile } from "fs/promises";
@@ -680,6 +680,8 @@ function parseCharProperties(doc, map) {
680
680
  else if (localTag === "strikeout") {
681
681
  const shape = k.getAttribute("shape") || "";
682
682
  if (isRealStrikeShape(shape)) prop.strike = true;
683
+ } else if (localTag === "underline") {
684
+ if (k.getAttribute("type") === "BOTTOM") prop.underline = true;
683
685
  }
684
686
  }
685
687
  const fontFaces = el.getElementsByTagName("*");
@@ -2378,21 +2380,22 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
2378
2380
  if (cp?.bold) span.bold = true;
2379
2381
  if (cp?.italic) span.italic = true;
2380
2382
  if (cp?.strike) span.strike = true;
2383
+ if (cp?.underline) span.underline = true;
2381
2384
  }
2382
- if (span.bold || span.italic || span.strike || span.code) styled = true;
2385
+ if (span.bold || span.italic || span.strike || span.underline || span.code) styled = true;
2383
2386
  spans.push(span);
2384
2387
  }
2385
2388
  if (!styled || spans.length === 0) return null;
2386
2389
  const merged = [];
2387
2390
  for (const s of spans) {
2388
2391
  const last = merged[merged.length - 1];
2389
- if (last && !!last.bold === !!s.bold && !!last.italic === !!s.italic && !!last.strike === !!s.strike && !!last.code === !!s.code) {
2392
+ if (last && !!last.bold === !!s.bold && !!last.italic === !!s.italic && !!last.strike === !!s.strike && !!last.underline === !!s.underline && !!last.code === !!s.code) {
2390
2393
  last.text += s.text;
2391
2394
  } else {
2392
2395
  merged.push(s);
2393
2396
  }
2394
2397
  }
2395
- if (requireMixed && !merged.some((s) => s.strike) && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
2398
+ if (requireMixed && !merged.some((s) => s.strike || s.underline) && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
2396
2399
  return merged;
2397
2400
  }
2398
2401
  function gongmunDepthFromIndent(para2, left, ctx) {
@@ -4744,7 +4747,11 @@ function parseParagraph(records, start, end, ctx) {
4744
4747
  const style = resolveCharStyle(charShapeIds, ctx.docInfo);
4745
4748
  if (style) {
4746
4749
  block.style = style;
4747
- if (style.strike) block.text = headMarker ? `${headMarker} ~~${trimmed}~~` : `~~${trimmed}~~`;
4750
+ if (style.strike || style.underline) {
4751
+ let deco = style.strike ? `~~${trimmed}~~` : trimmed;
4752
+ if (style.underline) deco = `<u>${deco}</u>`;
4753
+ block.text = headMarker ? `${headMarker} ${deco}` : deco;
4754
+ }
4748
4755
  }
4749
4756
  }
4750
4757
  if (footnotes.length > 0) block.footnoteText = footnotes.join("; ");
@@ -5137,13 +5144,17 @@ function resolveCharStyle(charShapeIds, docInfo) {
5137
5144
  if (cs.attrFlags & 1) style.italic = true;
5138
5145
  if (cs.attrFlags & 2) style.bold = true;
5139
5146
  if (hasRealStrike(cs.attrFlags)) style.strike = true;
5140
- return style.fontSize || style.bold || style.italic || style.strike ? style : void 0;
5147
+ if (hasRealUnderline(cs.attrFlags)) style.underline = true;
5148
+ return style.fontSize || style.bold || style.italic || style.strike || style.underline ? style : void 0;
5141
5149
  }
5142
5150
  function hasRealStrike(attrFlags) {
5143
5151
  const strikeBits = attrFlags >> 18 & 7;
5144
5152
  const shapeId = attrFlags >> 26 & 15;
5145
5153
  return strikeBits !== 0 && shapeId <= 12;
5146
5154
  }
5155
+ function hasRealUnderline(attrFlags) {
5156
+ return (attrFlags >> 2 & 3) === 1;
5157
+ }
5147
5158
 
5148
5159
  // src/hwp3/parser.ts
5149
5160
  import { inflateRawSync as inflateRawSync5 } from "zlib";
@@ -22878,6 +22889,7 @@ function parseInlineMarkdown(text) {
22878
22889
  });
22879
22890
  text = text.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1");
22880
22891
  text = text.replace(/~~([^~]+)~~/g, "$1");
22892
+ text = text.replace(/<u>([^<]*)<\/u>/g, "$1");
22881
22893
  let spans;
22882
22894
  if (inlineDoc) {
22883
22895
  spans = [];
@@ -31312,7 +31324,7 @@ async function parse(input, options) {
31312
31324
  }
31313
31325
  async function parseImage(buffer, options) {
31314
31326
  try {
31315
- const { parseImageDocument } = await import("./image-ocr-3A3HZX6O.js");
31327
+ const { parseImageDocument } = await import("./image-ocr-TAJHRZ5T.js");
31316
31328
  const { blocks, warnings } = await parseImageDocument(buffer, options);
31317
31329
  return {
31318
31330
  success: true,
@@ -31371,7 +31383,7 @@ async function parseHwp(buffer, options) {
31371
31383
  async function parsePdf(buffer, options) {
31372
31384
  let parsePdfDocument;
31373
31385
  try {
31374
- const mod = await import("./parser-EQN4YKU4.js");
31386
+ const mod = await import("./parser-RCEHB2EV.js");
31375
31387
  parsePdfDocument = mod.parsePdfDocument;
31376
31388
  } catch {
31377
31389
  return {