kordoc 4.18.13 → 4.19.0

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 (129) hide show
  1. package/README.md +2 -1
  2. package/dist/{-DC2OO5KO.js → -I3DEUQUC.js} +11 -11
  3. package/dist/{chunk-K6WSMTVU.cjs → chunk-34RIECIF.cjs} +2 -2
  4. package/dist/{chunk-K6WSMTVU.cjs.map → chunk-34RIECIF.cjs.map} +1 -1
  5. package/dist/{chunk-EBXJ45VZ.js → chunk-5B55S4JU.js} +2 -2
  6. package/dist/{chunk-EBXJ45VZ.js.map → chunk-5B55S4JU.js.map} +1 -1
  7. package/dist/{chunk-6CQZMVXW.cjs → chunk-5ZSQ2ZIH.cjs} +3 -3
  8. package/dist/{chunk-6CQZMVXW.cjs.map → chunk-5ZSQ2ZIH.cjs.map} +1 -1
  9. package/dist/{chunk-GGMIPTM5.cjs → chunk-7TVRQJXI.cjs} +12 -12
  10. package/dist/{chunk-GGMIPTM5.cjs.map → chunk-7TVRQJXI.cjs.map} +1 -1
  11. package/dist/{chunk-6AYTYTFY.js → chunk-AAE765MK.js} +3 -3
  12. package/dist/{chunk-ISC2TH24.js → chunk-AMDDV4CI.js} +2 -2
  13. package/dist/{chunk-GUH6HYSZ.js → chunk-C4JHZNRL.js} +25 -22
  14. package/dist/chunk-C4JHZNRL.js.map +1 -0
  15. package/dist/{chunk-EZSWBHHI.js → chunk-CR4RXHXO.js} +2 -2
  16. package/dist/{chunk-32ZUIHSY.js → chunk-DEYCTP2S.js} +3 -3
  17. package/dist/{chunk-SVIOP7PE.js → chunk-DGXGVC4Z.js} +7 -7
  18. package/dist/{chunk-SVIOP7PE.js.map → chunk-DGXGVC4Z.js.map} +1 -1
  19. package/dist/{chunk-JPSLMPFI.js → chunk-DH75ZUYF.js} +95 -11
  20. package/dist/chunk-DH75ZUYF.js.map +1 -0
  21. package/dist/{chunk-DHEUQXXR.js → chunk-FJE3TMZ7.js} +2 -2
  22. package/dist/{chunk-ZNY5BRV6.js → chunk-GCYLNOTJ.js} +4 -4
  23. package/dist/{chunk-GSW7W7AL.js → chunk-GYQVQF2J.js} +7 -4
  24. package/dist/chunk-GYQVQF2J.js.map +1 -0
  25. package/dist/{chunk-7LOD4IGO.js → chunk-HFMIAMEO.js} +4 -4
  26. package/dist/{chunk-XVB3PUPJ.js → chunk-L5KNWOGR.js} +2 -2
  27. package/dist/chunk-L5KNWOGR.js.map +1 -0
  28. package/dist/{chunk-RQEDNI4P.cjs → chunk-LLVF6X5W.cjs} +3 -3
  29. package/dist/{chunk-RQEDNI4P.cjs.map → chunk-LLVF6X5W.cjs.map} +1 -1
  30. package/dist/{chunk-6FW3AZWN.cjs → chunk-LNU54ZKV.cjs} +117 -33
  31. package/dist/chunk-LNU54ZKV.cjs.map +1 -0
  32. package/dist/{chunk-IRN5SDY2.js → chunk-OMJWAJBD.js} +2 -2
  33. package/dist/{chunk-V7LKQNC4.js → chunk-QHN7N2QA.js} +2 -2
  34. package/dist/{chunk-INESPVEV.js → chunk-RYKNAYKC.js} +3 -3
  35. package/dist/{chunk-LKA7Z2NH.js → chunk-UCTD3BXH.js} +2 -2
  36. package/dist/{chunk-PN5WWW56.js → chunk-UTVNSCEI.js} +2 -2
  37. package/dist/{chunk-PN5WWW56.js.map → chunk-UTVNSCEI.js.map} +1 -1
  38. package/dist/{chunk-JWTZ3OVZ.js → chunk-VZSOPECZ.js} +2 -2
  39. package/dist/{chunk-VDEENOPW.js → chunk-W5XX2GKO.js} +2 -2
  40. package/dist/{chunk-PHMWSWHJ.js → chunk-XIWGPC3V.js} +2 -2
  41. package/dist/{chunk-JKHU7HID.js → chunk-XXUXQHUC.js} +95 -11
  42. package/dist/chunk-XXUXQHUC.js.map +1 -0
  43. package/dist/{chunk-3FGHQWJP.cjs → chunk-YV4PWWRW.cjs} +22 -22
  44. package/dist/{chunk-3FGHQWJP.cjs.map → chunk-YV4PWWRW.cjs.map} +1 -1
  45. package/dist/chunks-JPNLQOVD.js +10 -0
  46. package/dist/cli.js +39 -28
  47. package/dist/cli.js.map +1 -1
  48. package/dist/{formula-YCAO5IVW.js → formula-DUEAYGIG.js} +4 -4
  49. package/dist/{formula-DAMFHLQO.js → formula-I4MAHCTZ.js} +3 -3
  50. package/dist/{formula-HJNQGPRC.cjs → formula-L2BKGA4J.cjs} +9 -9
  51. package/dist/{formula-HJNQGPRC.cjs.map → formula-L2BKGA4J.cjs.map} +1 -1
  52. package/dist/{image-ocr-VH54SDZ7.js → image-ocr-B32G24XW.js} +6 -6
  53. package/dist/{image-ocr-PAF76DAW.js → image-ocr-NUL3JKXM.js} +9 -9
  54. package/dist/{image-ocr-AZ25IOC7.cjs → image-ocr-ZWRJZKYR.cjs} +15 -15
  55. package/dist/{image-ocr-AZ25IOC7.cjs.map → image-ocr-ZWRJZKYR.cjs.map} +1 -1
  56. package/dist/index.cjs +669 -663
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.d.cts +15 -2
  59. package/dist/index.d.ts +15 -2
  60. package/dist/index.js +26 -20
  61. package/dist/index.js.map +1 -1
  62. package/dist/mcp.js +25 -23
  63. package/dist/mcp.js.map +1 -1
  64. package/dist/{model-bundle-53CHDYCG.js → model-bundle-OBIKG4K5.js} +5 -5
  65. package/dist/{models-UVLAKK3M.js → models-2OZHOPPM.js} +5 -5
  66. package/dist/{parser-HWAOPQYK.cjs → parser-DMWCXX7A.cjs} +131 -129
  67. package/dist/parser-DMWCXX7A.cjs.map +1 -0
  68. package/dist/{parser-I4D3TRGU.js → parser-FDE6GQST.js} +14 -12
  69. package/dist/{parser-Z6PHB54O.js.map → parser-FDE6GQST.js.map} +1 -1
  70. package/dist/{parser-Z6PHB54O.js → parser-YW3NMSJE.js} +11 -9
  71. package/dist/{parser-I4D3TRGU.js.map → parser-YW3NMSJE.js.map} +1 -1
  72. package/dist/pdf-ocr-7MR56U4P.js +16 -0
  73. package/dist/pdf-ocr-K2OK7FNQ.cjs +17 -0
  74. package/dist/{pdf-ocr-HR6CXGTX.cjs.map → pdf-ocr-K2OK7FNQ.cjs.map} +1 -1
  75. package/dist/pdf-ocr-YHC4X67W.js +20 -0
  76. package/dist/{profile-io-WHCWCOPW.js → profile-io-6WCU4KHY.js} +3 -3
  77. package/dist/{rasterize-5DZ3DHGH.js → rasterize-X3I7SWXF.js} +3 -3
  78. package/dist/{redact-doc-RNJVMFGQ.js → redact-doc-6H7WPUQD.js} +11 -11
  79. package/dist/{render-NZ6RA6SW.js → render-PBQJGZT3.js} +7 -7
  80. package/dist/seal-E2E7CFZJ.js +10 -0
  81. package/dist/{setup-U3EQNK4Z.js → setup-UORJSR3M.js} +3 -3
  82. package/dist/visual-4GDT5BRH.js +20 -0
  83. package/dist/{watch-GB2M7XU6.js → watch-S2ZMDDZU.js} +12 -12
  84. package/package.json +3 -2
  85. package/dist/chunk-6FW3AZWN.cjs.map +0 -1
  86. package/dist/chunk-GSW7W7AL.js.map +0 -1
  87. package/dist/chunk-GUH6HYSZ.js.map +0 -1
  88. package/dist/chunk-JKHU7HID.js.map +0 -1
  89. package/dist/chunk-JPSLMPFI.js.map +0 -1
  90. package/dist/chunk-XVB3PUPJ.js.map +0 -1
  91. package/dist/chunks-JZW2TXIZ.js +0 -10
  92. package/dist/parser-HWAOPQYK.cjs.map +0 -1
  93. package/dist/pdf-ocr-F4ICXO7W.js +0 -20
  94. package/dist/pdf-ocr-HR6CXGTX.cjs +0 -17
  95. package/dist/pdf-ocr-JI3K7JIN.js +0 -16
  96. package/dist/seal-WHJ6O5HT.js +0 -10
  97. package/dist/visual-JDAS4R43.js +0 -20
  98. /package/dist/{-DC2OO5KO.js.map → -I3DEUQUC.js.map} +0 -0
  99. /package/dist/{chunk-6AYTYTFY.js.map → chunk-AAE765MK.js.map} +0 -0
  100. /package/dist/{chunk-ISC2TH24.js.map → chunk-AMDDV4CI.js.map} +0 -0
  101. /package/dist/{chunk-EZSWBHHI.js.map → chunk-CR4RXHXO.js.map} +0 -0
  102. /package/dist/{chunk-32ZUIHSY.js.map → chunk-DEYCTP2S.js.map} +0 -0
  103. /package/dist/{chunk-DHEUQXXR.js.map → chunk-FJE3TMZ7.js.map} +0 -0
  104. /package/dist/{chunk-ZNY5BRV6.js.map → chunk-GCYLNOTJ.js.map} +0 -0
  105. /package/dist/{chunk-7LOD4IGO.js.map → chunk-HFMIAMEO.js.map} +0 -0
  106. /package/dist/{chunk-IRN5SDY2.js.map → chunk-OMJWAJBD.js.map} +0 -0
  107. /package/dist/{chunk-V7LKQNC4.js.map → chunk-QHN7N2QA.js.map} +0 -0
  108. /package/dist/{chunk-INESPVEV.js.map → chunk-RYKNAYKC.js.map} +0 -0
  109. /package/dist/{chunk-LKA7Z2NH.js.map → chunk-UCTD3BXH.js.map} +0 -0
  110. /package/dist/{chunk-JWTZ3OVZ.js.map → chunk-VZSOPECZ.js.map} +0 -0
  111. /package/dist/{chunk-VDEENOPW.js.map → chunk-W5XX2GKO.js.map} +0 -0
  112. /package/dist/{chunk-PHMWSWHJ.js.map → chunk-XIWGPC3V.js.map} +0 -0
  113. /package/dist/{chunks-JZW2TXIZ.js.map → chunks-JPNLQOVD.js.map} +0 -0
  114. /package/dist/{formula-YCAO5IVW.js.map → formula-DUEAYGIG.js.map} +0 -0
  115. /package/dist/{formula-DAMFHLQO.js.map → formula-I4MAHCTZ.js.map} +0 -0
  116. /package/dist/{image-ocr-VH54SDZ7.js.map → image-ocr-B32G24XW.js.map} +0 -0
  117. /package/dist/{image-ocr-PAF76DAW.js.map → image-ocr-NUL3JKXM.js.map} +0 -0
  118. /package/dist/{model-bundle-53CHDYCG.js.map → model-bundle-OBIKG4K5.js.map} +0 -0
  119. /package/dist/{models-UVLAKK3M.js.map → models-2OZHOPPM.js.map} +0 -0
  120. /package/dist/{pdf-ocr-F4ICXO7W.js.map → pdf-ocr-7MR56U4P.js.map} +0 -0
  121. /package/dist/{pdf-ocr-JI3K7JIN.js.map → pdf-ocr-YHC4X67W.js.map} +0 -0
  122. /package/dist/{profile-io-WHCWCOPW.js.map → profile-io-6WCU4KHY.js.map} +0 -0
  123. /package/dist/{rasterize-5DZ3DHGH.js.map → rasterize-X3I7SWXF.js.map} +0 -0
  124. /package/dist/{redact-doc-RNJVMFGQ.js.map → redact-doc-6H7WPUQD.js.map} +0 -0
  125. /package/dist/{render-NZ6RA6SW.js.map → render-PBQJGZT3.js.map} +0 -0
  126. /package/dist/{seal-WHJ6O5HT.js.map → seal-E2E7CFZJ.js.map} +0 -0
  127. /package/dist/{setup-U3EQNK4Z.js.map → setup-UORJSR3M.js.map} +0 -0
  128. /package/dist/{visual-JDAS4R43.js.map → visual-4GDT5BRH.js.map} +0 -0
  129. /package/dist/{watch-GB2M7XU6.js.map → watch-S2ZMDDZU.js.map} +0 -0
package/dist/index.d.cts CHANGED
@@ -116,6 +116,8 @@ interface IRTable {
116
116
  classification?: TableClassificationSummary;
117
117
  /** 원본 표 식별자(HWPX `hp:tbl id`) — 렌더 region(`RenderRegion.sourceId`)과의 조인 키 */
118
118
  sourceId?: string;
119
+ /** `tableFormat: "gfm"` 관계 표지의 표 id(`t1`, `t2` …) — 문서 블록 트리 전위 순회 순번. 그 옵션으로 렌더할 때만 채워진다(원본 id 아님) */
120
+ markdownId?: string;
119
121
  /** 렌더 인프라가 준 페이지 로컬 pt 조각(다중 페이지 표는 여럿) — extractTables 가 채운다 */
120
122
  regions?: BoundingBox[];
121
123
  /** 표 캡션 (예: "표 1. 부서별 예산") — v3.0 */
@@ -206,6 +208,9 @@ interface ParseOptions {
206
208
  /** 모든 표를 HTML 로 — 파이프 표도 HTML 표로 옮기고, 표마다 태그를 한 줄씩 들여써 낸다(BeautifulSoup prettify 모양, 첫 행 `<th>`).
207
209
  * HTML 표만 다루는 소비자·채점기용. 기본 false(병합·중첩 없는 표는 GFM 파이프 표) */
208
210
  htmlTables?: boolean;
211
+ /** `"gfm"`: 모든 표를 HTML 없이 GFM 파이프 표로 — 세로 병합 칸은 덮인 행마다 같은 값, 가로 병합 칸은 시작 칸에만 값, 셀 안 표는 부모 표 뒤 독립 표로 꺼내고
212
+ * 부모·자식 관계를 `<!-- <table id="t2" parent_id="t1" /> -->` 표지로 남긴다(RAG 색인용). `htmlTables` 와 함께 쓸 수 없다. 기본: 병합·중첩 표는 HTML */
213
+ tableFormat?: "gfm";
209
214
  /** 표 오른쪽 끝의 빈 열(서식 문서의 입력란) 보존 (#47).
210
215
  * 기본 false: 마크다운 가독성을 위해 후행 빈 열을 트림.
211
216
  * 양식 인식 경로(parse_form·fill)는 내부적으로 항상 켠다. */
@@ -1568,7 +1573,13 @@ declare function applySplices(xml: string, splices: SpliceEdit[]): string;
1568
1573
  /** 2-pass colSpan/rowSpan 테이블 빌더 및 Markdown 변환 */
1569
1574
 
1570
1575
  declare function flattenLayoutTables(blocks: IRBlock[]): IRBlock[];
1571
- declare function blocksToMarkdown(blocks: IRBlock[]): string;
1576
+ /** blocksToMarkdown 렌더 옵션 */
1577
+ interface MarkdownOptions {
1578
+ /** 표 출력 형식 (`ParseOptions.tableFormat`). "gfm": 모든 표를 HTML 없이 GFM 파이프 표로 — 셀 안 표는 부모 뒤 독립 표로 꺼내고
1579
+ * 부모·자식 관계를 HTML 주석 표지로 남긴다. 기본(미지정)은 병합·중첩 표를 HTML 로 */
1580
+ tableFormat?: "gfm";
1581
+ }
1582
+ declare function blocksToMarkdown(blocks: IRBlock[], options?: MarkdownOptions): string;
1572
1583
  /**
1573
1584
  * 셀에 GFM 표 문법으로 담을 수 없는 구조 콘텐츠(중첩표·구분선)가 있는가 (#76 Task 4) — hasNestedTables 의 일반화.
1574
1585
  * 이미지는 GFM 셀에 `![image](src)` 로 인라인할 수 있어 여기 세지 않는다 — 대신 GFM 경로가 blocks 를 직접 직렬화해
@@ -1762,6 +1773,8 @@ interface ChunkOptions {
1762
1773
  * "block": IRBlock 1개 = 청크 1개
1763
1774
  */
1764
1775
  granularity?: "block" | "section";
1776
+ /** 표 출력 형식 — `ParseOptions.tableFormat` 과 같다. "gfm" 이면 표 id 를 문서 전체 순번으로 붙인 뒤 청크마다 렌더한다 */
1777
+ tableFormat?: "gfm";
1765
1778
  }
1766
1779
  declare function blocksToChunks(blocks: IRBlock[], options?: ChunkOptions): DocChunk[];
1767
1780
 
@@ -2340,4 +2353,4 @@ interface FillFormOutput {
2340
2353
  */
2341
2354
  declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
2342
2355
 
2343
- export { BUILTIN_TEMPLATES, type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type BuiltinTemplate, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, type ClassifyContext, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractRegionOptions, type ExtractTableVisualOptions, type ExtractedImage, type ExtractedTable, type ExtractedTableCrop, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type MuncheLineKind, type MuncheLintFinding, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageBBox, type PageMargin, type PageMarkdown, type PageOptions, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RegionAsset, type RenderAsset, type RenderDocumentOptions, type RenderDocumentResult, type RenderFormat, type RenderObjectType, type RenderRegion, type RenderScene, type RenderSourceFormat, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type ScenePage, type SceneRenderOptions, type SceneRenderResult, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, type TableRepresentation, type TableVisualPolicy, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, flattenLayoutTables, formatFillValue, gongmunLintWarnings, hasStructuredCellContent, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, lintMuncheText, markdownToHwpx, markdownToPdf, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parsePptx, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, usesGaejosikMunche, validateHwpx };
2356
+ export { BUILTIN_TEMPLATES, type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type BuiltinTemplate, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, type ClassifyContext, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractRegionOptions, type ExtractTableVisualOptions, type ExtractedImage, type ExtractedTable, type ExtractedTableCrop, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownOptions, type MarkdownToHwpxOptions, type MeasureOptions, type MuncheLineKind, type MuncheLintFinding, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageBBox, type PageMargin, type PageMarkdown, type PageOptions, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RegionAsset, type RenderAsset, type RenderDocumentOptions, type RenderDocumentResult, type RenderFormat, type RenderObjectType, type RenderRegion, type RenderScene, type RenderSourceFormat, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type ScenePage, type SceneRenderOptions, type SceneRenderResult, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, type TableRepresentation, type TableVisualPolicy, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, flattenLayoutTables, formatFillValue, gongmunLintWarnings, hasStructuredCellContent, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, lintMuncheText, markdownToHwpx, markdownToPdf, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parsePptx, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, usesGaejosikMunche, validateHwpx };
package/dist/index.d.ts CHANGED
@@ -116,6 +116,8 @@ interface IRTable {
116
116
  classification?: TableClassificationSummary;
117
117
  /** 원본 표 식별자(HWPX `hp:tbl id`) — 렌더 region(`RenderRegion.sourceId`)과의 조인 키 */
118
118
  sourceId?: string;
119
+ /** `tableFormat: "gfm"` 관계 표지의 표 id(`t1`, `t2` …) — 문서 블록 트리 전위 순회 순번. 그 옵션으로 렌더할 때만 채워진다(원본 id 아님) */
120
+ markdownId?: string;
119
121
  /** 렌더 인프라가 준 페이지 로컬 pt 조각(다중 페이지 표는 여럿) — extractTables 가 채운다 */
120
122
  regions?: BoundingBox[];
121
123
  /** 표 캡션 (예: "표 1. 부서별 예산") — v3.0 */
@@ -206,6 +208,9 @@ interface ParseOptions {
206
208
  /** 모든 표를 HTML 로 — 파이프 표도 HTML 표로 옮기고, 표마다 태그를 한 줄씩 들여써 낸다(BeautifulSoup prettify 모양, 첫 행 `<th>`).
207
209
  * HTML 표만 다루는 소비자·채점기용. 기본 false(병합·중첩 없는 표는 GFM 파이프 표) */
208
210
  htmlTables?: boolean;
211
+ /** `"gfm"`: 모든 표를 HTML 없이 GFM 파이프 표로 — 세로 병합 칸은 덮인 행마다 같은 값, 가로 병합 칸은 시작 칸에만 값, 셀 안 표는 부모 표 뒤 독립 표로 꺼내고
212
+ * 부모·자식 관계를 `<!-- <table id="t2" parent_id="t1" /> -->` 표지로 남긴다(RAG 색인용). `htmlTables` 와 함께 쓸 수 없다. 기본: 병합·중첩 표는 HTML */
213
+ tableFormat?: "gfm";
209
214
  /** 표 오른쪽 끝의 빈 열(서식 문서의 입력란) 보존 (#47).
210
215
  * 기본 false: 마크다운 가독성을 위해 후행 빈 열을 트림.
211
216
  * 양식 인식 경로(parse_form·fill)는 내부적으로 항상 켠다. */
@@ -1568,7 +1573,13 @@ declare function applySplices(xml: string, splices: SpliceEdit[]): string;
1568
1573
  /** 2-pass colSpan/rowSpan 테이블 빌더 및 Markdown 변환 */
1569
1574
 
1570
1575
  declare function flattenLayoutTables(blocks: IRBlock[]): IRBlock[];
1571
- declare function blocksToMarkdown(blocks: IRBlock[]): string;
1576
+ /** blocksToMarkdown 렌더 옵션 */
1577
+ interface MarkdownOptions {
1578
+ /** 표 출력 형식 (`ParseOptions.tableFormat`). "gfm": 모든 표를 HTML 없이 GFM 파이프 표로 — 셀 안 표는 부모 뒤 독립 표로 꺼내고
1579
+ * 부모·자식 관계를 HTML 주석 표지로 남긴다. 기본(미지정)은 병합·중첩 표를 HTML 로 */
1580
+ tableFormat?: "gfm";
1581
+ }
1582
+ declare function blocksToMarkdown(blocks: IRBlock[], options?: MarkdownOptions): string;
1572
1583
  /**
1573
1584
  * 셀에 GFM 표 문법으로 담을 수 없는 구조 콘텐츠(중첩표·구분선)가 있는가 (#76 Task 4) — hasNestedTables 의 일반화.
1574
1585
  * 이미지는 GFM 셀에 `![image](src)` 로 인라인할 수 있어 여기 세지 않는다 — 대신 GFM 경로가 blocks 를 직접 직렬화해
@@ -1762,6 +1773,8 @@ interface ChunkOptions {
1762
1773
  * "block": IRBlock 1개 = 청크 1개
1763
1774
  */
1764
1775
  granularity?: "block" | "section";
1776
+ /** 표 출력 형식 — `ParseOptions.tableFormat` 과 같다. "gfm" 이면 표 id 를 문서 전체 순번으로 붙인 뒤 청크마다 렌더한다 */
1777
+ tableFormat?: "gfm";
1765
1778
  }
1766
1779
  declare function blocksToChunks(blocks: IRBlock[], options?: ChunkOptions): DocChunk[];
1767
1780
 
@@ -2340,4 +2353,4 @@ interface FillFormOutput {
2340
2353
  */
2341
2354
  declare function fillForm(input: string | ArrayBuffer | Buffer, values: Record<string, FillInput>, outputFormat?: FillOutputFormat): Promise<FillFormOutput>;
2342
2355
 
2343
- export { BUILTIN_TEMPLATES, type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type BuiltinTemplate, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, type ClassifyContext, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractRegionOptions, type ExtractTableVisualOptions, type ExtractedImage, type ExtractedTable, type ExtractedTableCrop, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownToHwpxOptions, type MeasureOptions, type MuncheLineKind, type MuncheLintFinding, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageBBox, type PageMargin, type PageMarkdown, type PageOptions, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RegionAsset, type RenderAsset, type RenderDocumentOptions, type RenderDocumentResult, type RenderFormat, type RenderObjectType, type RenderRegion, type RenderScene, type RenderSourceFormat, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type ScenePage, type SceneRenderOptions, type SceneRenderResult, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, type TableRepresentation, type TableVisualPolicy, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, flattenLayoutTables, formatFillValue, gongmunLintWarnings, hasStructuredCellContent, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, lintMuncheText, markdownToHwpx, markdownToPdf, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parsePptx, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, usesGaejosikMunche, validateHwpx };
2356
+ export { BUILTIN_TEMPLATES, type BlockCapability, type BlockCapabilityInfo, type BlockDiff, type BlockEdit, type BlockSourceRef, type BorderDef, type BorderFillDef, type BoundingBox, type BuiltinTemplate, type CellCapability, type CellContext, type CellDiff, type CellProfile, type CharPrDef, type ChunkOptions, type ClassifyContext, type ClickHereField, DEFAULT_REDACT_RULES, type DiffChangeType, type DiffResult, type DocChunk, type DocumentMetadata, type DocumentQualitySummary, type ErrorCode, type ExtractRegionOptions, type ExtractTableVisualOptions, type ExtractedImage, type ExtractedTable, type ExtractedTableCrop, type FileType, type FillFormOutput, type FillInput, type FillOutputFormat, type FillResult, type FillValue, type FormField, type FormFieldSchema, type FormFieldType, type FormResult, type FormSchemaResult, type FormatProfile, type GongmunFont, type GongmunLintFinding, type GongmunNumbering, type GongmunOptions, type GongmunPreset, type GongmunPresetInput, type HwpxFillResult, HwpxSession, type HwpxTheme, type IRBlock, type IRBlockType, type IRCell, type IRTable, type ImageData, type InlineStyle, type MarkdownOptions, type MarkdownToHwpxOptions, type MeasureOptions, type MuncheLineKind, type MuncheLintFinding, type OcrProvider, type OutlineItem, PRESET_ALIAS, type PageBBox, type PageMargin, type PageMarkdown, type PageOptions, type PageQuality, type ParseFailure, type ParseOptions, type ParseResult, type ParseSuccess, type ParseWarning, type PatchOptions, type PatchResult, type PatchSkip, type PlaceSealResult, type PrintOptions, type PrintPreset, type RedactHit, type RedactOptions, type RedactRule, type RedactTextResult, type RegionAsset, type RenderAsset, type RenderDocumentOptions, type RenderDocumentResult, type RenderFormat, type RenderObjectType, type RenderRegion, type RenderScene, type RenderSourceFormat, type RenderSvgOptions, type RenderSvgResult, SPACE_EM_FIXED, SPACE_EM_FONT, type ScanCell, type ScanParaKind, type ScanParagraph, type ScanTable, type ScenePage, type SceneRenderOptions, type SceneRenderResult, type SealOp, type SealPlacement, type SectionScan, type SpliceEdit, type TRange, type TableProfile, type TableRepresentation, type TableVisualPolicy, VERSION, type ValidateIssue, type ValidateResult, ValueCursor, type WarningCode, type WatchOptions, type WrapMode, type WrapResult, applySplices, blocksToChunks, blocksToMarkdown, blocksToPages, blocksToPdf, buildParagraphSplices, buildRangeSplices, charWidthEm1000, chooseTableRepresentation, classifyTable, classifyTableTree, collectTableBlocks, compare, detectFormat, detectOle2Format, detectZipFormat, diffBlocks, extractClickHereFields, extractFormFields, extractFormSchema, extractRenderedRegions, extractTables, fillForm, fillFormFields, fillHwpx, fillWithUniqueGuard, fitRatioForFewerLines, flattenLayoutTables, formatFillValue, gongmunLintWarnings, hasStructuredCellContent, hwpxToProfile, incompatibleGongmunWarnings, inferFieldType, isHwpxFile, isKnownFont, isLabelCell, isOldHwpFile, isPdfFile, isZipFile, lintGongmunText, lintMuncheText, markdownToHwpx, markdownToPdf, measureTextWidth, muncheLintWarnings, normalizeGongmunPreset, openHwpxDocument, parse, parseDocx, parseHwp, parseHwp3, parseHwpml, parseHwpx, parseImage, parsePdf, parsePptx, parseXls, parseXlsx, patchHwp, patchHwpx, patchHwpxBlocks, placeSealHwpx, readBuiltinTemplate, readBuiltinTemplateSample, redactMarkdown, redactText, renderDocument, renderDocumentToScene, renderHtml, renderHwp5Pages, renderHwpxToSvg, renderSceneToHtml, resolveBuiltinTemplate, scanSectionXml, simulateWrap, simulateWrapKeepWord, unknownFontWarnings, usesGaejosikMunche, validateHwpx };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  blocksToPages,
3
3
  inlineImagesIntoMarkdown
4
- } from "./chunk-VDEENOPW.js";
4
+ } from "./chunk-W5XX2GKO.js";
5
5
  import {
6
6
  parsePageRange
7
7
  } from "./chunk-V4BH5SRQ.js";
@@ -13,6 +13,7 @@ import {
13
13
  MAX_COLS,
14
14
  MAX_ROWS,
15
15
  MAX_TABLE_CELLS,
16
+ assignTableIds,
16
17
  blocksToMarkdown,
17
18
  buildTable,
18
19
  convertTableToText,
@@ -31,7 +32,7 @@ import {
31
32
  tidyScriptTags,
32
33
  unframeLayoutTables,
33
34
  wrapScript
34
- } from "./chunk-JPSLMPFI.js";
35
+ } from "./chunk-DH75ZUYF.js";
35
36
  import {
36
37
  KordocError,
37
38
  OPTIONAL_DEP_INSTALL_HINT,
@@ -49,7 +50,7 @@ import {
49
50
  toArrayBuffer,
50
51
  unescapeHtml,
51
52
  unzipLimitBytes
52
- } from "./chunk-EBXJ45VZ.js";
53
+ } from "./chunk-5B55S4JU.js";
53
54
 
54
55
  // src/plain-markdown.ts
55
56
  function toPlainMarkdown(md2) {
@@ -3667,7 +3668,7 @@ import JSZip2 from "jszip";
3667
3668
 
3668
3669
  // src/hwpx/zip-sections.ts
3669
3670
  import { inflateRawSync as inflateRawSync3 } from "zlib";
3670
- function extractFromBrokenZip(buffer) {
3671
+ function extractFromBrokenZip(buffer, options) {
3671
3672
  const data = new Uint8Array(buffer);
3672
3673
  const view = new DataView(buffer);
3673
3674
  let pos = 0;
@@ -3734,7 +3735,7 @@ function extractFromBrokenZip(buffer) {
3734
3735
  }
3735
3736
  if (blocks.length === 0) throw new KordocError("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
3736
3737
  applyPageText(blocks, shared);
3737
- const markdown = blocksToMarkdown(blocks);
3738
+ const markdown = blocksToMarkdown(blocks, { tableFormat: options?.tableFormat });
3738
3739
  return { markdown, blocks, warnings: warnings.length > 0 ? warnings : void 0 };
3739
3740
  }
3740
3741
  async function readKordocLayout(zip) {
@@ -3895,7 +3896,7 @@ async function parseHwpxDocument(buffer, options) {
3895
3896
  try {
3896
3897
  zip = await JSZip3.loadAsync(buffer);
3897
3898
  } catch {
3898
- return extractFromBrokenZip(buffer);
3899
+ return extractFromBrokenZip(buffer, options);
3899
3900
  }
3900
3901
  const actualEntryCount = Object.keys(zip.files).length;
3901
3902
  if (actualEntryCount > MAX_ZIP_ENTRIES) {
@@ -3977,7 +3978,7 @@ async function parseHwpxDocument(buffer, options) {
3977
3978
  const shown = options?.layoutTables === "keep" ? blocks : unframeLayoutTables(blocks, !!options?.keepTrailingEmptyCols);
3978
3979
  detectHwpxHeadings(shown, styleMap, shared.tocTexts);
3979
3980
  const outline = shown.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
3980
- const markdown = blocksToMarkdown(shown);
3981
+ const markdown = blocksToMarkdown(shown, { tableFormat: options?.tableFormat });
3981
3982
  return { markdown, blocks: shown, metadata, outline: outline.length > 0 ? outline : void 0, warnings: warnings.length > 0 ? warnings : void 0, images: images.length > 0 ? images : void 0 };
3982
3983
  }
3983
3984
 
@@ -6097,7 +6098,7 @@ function parseHwp5Document(buffer, options) {
6097
6098
  detectHwp5Headings(flatBlocks, docInfo, doc.tocTexts);
6098
6099
  }
6099
6100
  const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
6100
- let markdown = blocksToMarkdown(flatBlocks);
6101
+ let markdown = blocksToMarkdown(flatBlocks, { tableFormat: options?.tableFormat });
6101
6102
  if (options?.inlineImages && options.images !== false && images.length > 0) {
6102
6103
  try {
6103
6104
  markdown = inlineImagesIntoMarkdown(markdown, images, { compress: true });
@@ -18982,7 +18983,7 @@ function parseHwp3Document(buffer, options) {
18982
18983
  version: "3.0"
18983
18984
  };
18984
18985
  return {
18985
- markdown: blocksToMarkdown(blocks),
18986
+ markdown: blocksToMarkdown(blocks, { tableFormat: options?.tableFormat }),
18986
18987
  blocks,
18987
18988
  metadata,
18988
18989
  warnings: warnings.length ? warnings : void 0
@@ -19724,7 +19725,7 @@ async function parseXlsxDocument(buffer, options) {
19724
19725
  } catch {
19725
19726
  }
19726
19727
  }
19727
- const markdown = blocksToMarkdown(blocks);
19728
+ const markdown = blocksToMarkdown(blocks, { tableFormat: options?.tableFormat });
19728
19729
  return { markdown, blocks, metadata, warnings: warnings.length > 0 ? warnings : void 0 };
19729
19730
  }
19730
19731
 
@@ -20332,7 +20333,7 @@ async function parseXlsDocument(buffer, options) {
20332
20333
  pageCount: totalSheets
20333
20334
  };
20334
20335
  return {
20335
- markdown: blocksToMarkdown(allBlocks),
20336
+ markdown: blocksToMarkdown(allBlocks, { tableFormat: options?.tableFormat }),
20336
20337
  blocks: allBlocks,
20337
20338
  metadata,
20338
20339
  warnings: warnings.length > 0 ? warnings : void 0
@@ -21496,7 +21497,7 @@ async function parseDocxDocument(buffer, options) {
21496
21497
  }
21497
21498
  }
21498
21499
  const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: b.level ?? 2, text: b.text ?? "" }));
21499
- const markdown = blocksToMarkdown(blocks);
21500
+ const markdown = blocksToMarkdown(blocks, { tableFormat: options?.tableFormat });
21500
21501
  return {
21501
21502
  markdown,
21502
21503
  blocks,
@@ -21818,7 +21819,7 @@ async function parsePptxDocument(buffer, options) {
21818
21819
  }
21819
21820
  const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: b.level ?? 2, text: b.text ?? "", pageNumber: b.pageNumber }));
21820
21821
  return {
21821
- markdown: blocksToMarkdown(blocks),
21822
+ markdown: blocksToMarkdown(blocks, { tableFormat: options?.tableFormat }),
21822
21823
  blocks,
21823
21824
  metadata,
21824
21825
  outline: outline.length > 0 ? outline : void 0,
@@ -21878,7 +21879,7 @@ function parseHwpmlDocument(buffer, options) {
21878
21879
  parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings, options?.keepTrailingEmptyCols ?? false);
21879
21880
  }
21880
21881
  const outline = blocks.filter((b) => b.type === "heading" && b.text).map((b) => ({ level: b.level ?? 1, text: b.text, pageNumber: b.pageNumber }));
21881
- const markdown = blocksToMarkdown(blocks);
21882
+ const markdown = blocksToMarkdown(blocks, { tableFormat: options?.tableFormat });
21882
21883
  return {
21883
21884
  markdown,
21884
21885
  blocks,
@@ -38603,6 +38604,8 @@ function sameBreadcrumb(a, b) {
38603
38604
  function blocksToChunks(blocks, options) {
38604
38605
  const granularity = options?.granularity ?? "section";
38605
38606
  const includeCells = options?.includeTableCells ?? false;
38607
+ const mdOptions = { tableFormat: options?.tableFormat };
38608
+ if (options?.tableFormat === "gfm") assignTableIds(blocks);
38606
38609
  const chunks = [];
38607
38610
  const headingStack = [];
38608
38611
  const listStack = [];
@@ -38616,12 +38619,12 @@ function blocksToChunks(blocks, options) {
38616
38619
  let run = null;
38617
38620
  const flushRun = () => {
38618
38621
  if (!run) return;
38619
- push("text", run.breadcrumb, blocksToMarkdown(run.blocks), [run.start, run.end], run.page);
38622
+ push("text", run.breadcrumb, blocksToMarkdown(run.blocks, mdOptions), [run.start, run.end], run.page);
38620
38623
  run = null;
38621
38624
  };
38622
38625
  for (let i = 0; i < blocks.length; i++) {
38623
38626
  const block = blocks[i];
38624
- const md2 = blocksToMarkdown([block]);
38627
+ const md2 = blocksToMarkdown([block], mdOptions);
38625
38628
  if (!md2) continue;
38626
38629
  if (block.type === "heading") {
38627
38630
  flushRun();
@@ -41553,6 +41556,9 @@ async function extractTables(input, options = {}) {
41553
41556
  async function parse(input, options) {
41554
41557
  let buffer;
41555
41558
  const opts = typeof input === "string" && !options?.filePath ? { ...options, filePath: input } : options;
41559
+ if (opts?.htmlTables && opts.tableFormat) {
41560
+ return { success: false, fileType: "unknown", error: "htmlTables \uC640 tableFormat \uC740 \uD568\uAED8 \uC4F8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4" };
41561
+ }
41556
41562
  if (typeof input === "string") {
41557
41563
  try {
41558
41564
  const buf = await readFile3(input);
@@ -41581,7 +41587,7 @@ async function parse(input, options) {
41581
41587
  out = { ...result, warnings: [...result.warnings ?? [], { code: "PARTIAL_PARSE", message: `\uC694\uCCAD\uD55C \uCABD \uBC94\uC704(${opts.pages})\uAC00 \uBB38\uC11C \uCABD(1~${result.pageCount})\uACFC \uACB9\uCE58\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4` }] };
41582
41588
  }
41583
41589
  if (out.success && !out.pages) {
41584
- const pages = blocksToPages(out.blocks);
41590
+ const pages = blocksToPages(out.blocks, (bs) => blocksToMarkdown(bs, { tableFormat: opts?.tableFormat }));
41585
41591
  if (pages) out = { ...out, pages };
41586
41592
  }
41587
41593
  if (out.success && opts?.plain) {
@@ -41634,13 +41640,13 @@ function scriptsOff(r, off) {
41634
41640
  }
41635
41641
  async function parseImage(buffer, options) {
41636
41642
  try {
41637
- const { parseImageDocument } = await import("./image-ocr-VH54SDZ7.js");
41643
+ const { parseImageDocument } = await import("./image-ocr-B32G24XW.js");
41638
41644
  const { blocks, warnings } = await parseImageDocument(buffer, options);
41639
41645
  stripScriptTags({ blocks });
41640
41646
  return {
41641
41647
  success: true,
41642
41648
  fileType: "image",
41643
- markdown: blocksToMarkdown(blocks),
41649
+ markdown: blocksToMarkdown(blocks, { tableFormat: options?.tableFormat }),
41644
41650
  blocks,
41645
41651
  warnings: warnings.length ? warnings : void 0,
41646
41652
  pageCount: 1
@@ -41694,7 +41700,7 @@ async function parseHwp(buffer, options) {
41694
41700
  async function parsePdf(buffer, options) {
41695
41701
  let parsePdfDocument;
41696
41702
  try {
41697
- const mod = await import("./parser-Z6PHB54O.js");
41703
+ const mod = await import("./parser-YW3NMSJE.js");
41698
41704
  parsePdfDocument = mod.parsePdfDocument;
41699
41705
  } catch {
41700
41706
  return {