kordoc 3.8.2 → 3.8.4
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 +14 -0
- package/dist/{-FEHSMPVO.js → -ZAIG6FWT.js} +3 -3
- package/dist/{chunk-JHZUFBUV.js → chunk-2UDAEQPW.js} +3 -3
- package/dist/chunk-2UDAEQPW.js.map +1 -0
- package/dist/{chunk-DP37KF2X.js → chunk-6EDNKPXQ.js} +146 -75
- package/dist/chunk-6EDNKPXQ.js.map +1 -0
- package/dist/{chunk-553VTUVP.js → chunk-T4SGNVVS.js} +3 -3
- package/dist/chunk-T4SGNVVS.js.map +1 -0
- package/dist/{chunk-YBPNKFJW.cjs → chunk-Z3O36LBJ.cjs} +3 -3
- package/dist/{chunk-YBPNKFJW.cjs.map → chunk-Z3O36LBJ.cjs.map} +1 -1
- package/dist/cli.js +4 -4
- package/dist/index.cjs +399 -328
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +145 -74
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +3 -3
- package/dist/{parser-NR2TYGO3.js → parser-2THIF623.js} +153 -7
- package/dist/parser-2THIF623.js.map +1 -0
- package/dist/{parser-KNQDRLZQ.js → parser-PR7CPMM4.js} +153 -7
- package/dist/parser-PR7CPMM4.js.map +1 -0
- package/dist/{parser-NS4ZPD7B.cjs → parser-ZVKCFXR3.cjs} +177 -31
- package/dist/parser-ZVKCFXR3.cjs.map +1 -0
- package/dist/{watch-XCWADLPU.js → watch-2HYPNMOB.js} +3 -3
- package/package.json +2 -1
- package/dist/chunk-553VTUVP.js.map +0 -1
- package/dist/chunk-DP37KF2X.js.map +0 -1
- package/dist/chunk-JHZUFBUV.js.map +0 -1
- package/dist/parser-KNQDRLZQ.js.map +0 -1
- package/dist/parser-NR2TYGO3.js.map +0 -1
- package/dist/parser-NS4ZPD7B.cjs.map +0 -1
- /package/dist/{-FEHSMPVO.js.map → -ZAIG6FWT.js.map} +0 -0
- /package/dist/{watch-XCWADLPU.js.map → watch-2HYPNMOB.js.map} +0 -0
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
sanitizeHref,
|
|
26
26
|
stripDtd,
|
|
27
27
|
toArrayBuffer
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-2UDAEQPW.js";
|
|
29
29
|
import {
|
|
30
30
|
parsePageRange
|
|
31
31
|
} from "./chunk-MOL7MDBG.js";
|
|
@@ -905,14 +905,14 @@ function resolveParaHeading(paraEl, ctx) {
|
|
|
905
905
|
const head = numDef.heads.get(level);
|
|
906
906
|
counters[level] = counters[level] === 0 ? head?.start ?? 1 : counters[level] + 1;
|
|
907
907
|
for (let l = level + 1; l <= 10; l++) counters[l] = 0;
|
|
908
|
-
const fmtText = head
|
|
908
|
+
const fmtText = head ? head.text.trim() : `^${level}.`;
|
|
909
909
|
const prefix = fmtText.replace(/\^(10|[1-9])/g, (_, d) => {
|
|
910
910
|
const lv = parseInt(d, 10);
|
|
911
911
|
const refHead = numDef.heads.get(lv);
|
|
912
912
|
const n = counters[lv] || refHead?.start || 1;
|
|
913
913
|
return formatHeadNumber(n, refHead?.numFormat || "DIGIT");
|
|
914
914
|
});
|
|
915
|
-
return { prefix, headingLevel };
|
|
915
|
+
return { prefix: prefix || void 0, headingLevel };
|
|
916
916
|
}
|
|
917
917
|
|
|
918
918
|
// src/hwpx/table-build.ts
|
|
@@ -16581,6 +16581,9 @@ function getElements(parent, tagName) {
|
|
|
16581
16581
|
const nodes = parent.getElementsByTagName(tagName);
|
|
16582
16582
|
const result = [];
|
|
16583
16583
|
for (let i = 0; i < nodes.length; i++) result.push(nodes[i]);
|
|
16584
|
+
if (result.length > 0) return result;
|
|
16585
|
+
const nsNodes = parent.getElementsByTagNameNS?.("*", tagName);
|
|
16586
|
+
if (nsNodes) for (let i = 0; i < nsNodes.length; i++) result.push(nsNodes[i]);
|
|
16584
16587
|
return result;
|
|
16585
16588
|
}
|
|
16586
16589
|
function getTextContent(el) {
|
|
@@ -18088,74 +18091,79 @@ function parseParagraph2(p, styles, numbering, footnotes, rels) {
|
|
|
18088
18091
|
if (footnoteText) block.footnoteText = footnoteText;
|
|
18089
18092
|
return block;
|
|
18090
18093
|
}
|
|
18094
|
+
function collectTextboxParagraphs(node, inTxbx = false, out = [], depth = 0) {
|
|
18095
|
+
if (depth > 40) return out;
|
|
18096
|
+
for (const el of effectiveChildElements(node)) {
|
|
18097
|
+
if (matchesLocal(el, "Fallback")) continue;
|
|
18098
|
+
const nowIn = inTxbx || matchesLocal(el, "txbxContent");
|
|
18099
|
+
if (nowIn && matchesLocal(el, "p")) out.push(el);
|
|
18100
|
+
collectTextboxParagraphs(el, nowIn, out, depth + 1);
|
|
18101
|
+
}
|
|
18102
|
+
return out;
|
|
18103
|
+
}
|
|
18091
18104
|
function parseTable(tbl, styles, numbering, footnotes, rels) {
|
|
18092
18105
|
const trElements = getChildElements(tbl, "tr");
|
|
18093
18106
|
if (trElements.length === 0) return null;
|
|
18094
|
-
const
|
|
18095
|
-
let maxCols = 0;
|
|
18107
|
+
const rawRows = [];
|
|
18096
18108
|
for (const tr of trElements) {
|
|
18097
|
-
const tcElements = getChildElements(tr, "tc");
|
|
18098
18109
|
const row = [];
|
|
18099
|
-
|
|
18110
|
+
let col = 0;
|
|
18111
|
+
for (const tc of getChildElements(tr, "tc")) {
|
|
18100
18112
|
let colSpan = 1;
|
|
18101
|
-
let
|
|
18113
|
+
let vMerge = null;
|
|
18102
18114
|
const tcPrEls = getChildElements(tc, "tcPr");
|
|
18103
18115
|
if (tcPrEls.length > 0) {
|
|
18104
18116
|
const gridSpanEls = getChildElements(tcPrEls[0], "gridSpan");
|
|
18105
18117
|
if (gridSpanEls.length > 0) {
|
|
18106
|
-
colSpan = parseInt(getAttr(gridSpanEls[0], "val") ?? "1", 10);
|
|
18118
|
+
colSpan = parseInt(getAttr(gridSpanEls[0], "val") ?? "1", 10) || 1;
|
|
18107
18119
|
}
|
|
18108
18120
|
const vMergeEls = getChildElements(tcPrEls[0], "vMerge");
|
|
18109
18121
|
if (vMergeEls.length > 0) {
|
|
18110
|
-
|
|
18111
|
-
if (val !== "restart" && val !== null) {
|
|
18112
|
-
row.push({ text: "", colSpan, rowSpan: 0 });
|
|
18113
|
-
continue;
|
|
18114
|
-
}
|
|
18122
|
+
vMerge = getAttr(vMergeEls[0], "val") === "restart" ? "restart" : "continue";
|
|
18115
18123
|
}
|
|
18116
18124
|
}
|
|
18117
|
-
const
|
|
18118
|
-
|
|
18119
|
-
|
|
18120
|
-
|
|
18121
|
-
|
|
18125
|
+
const text = vMerge === "continue" ? "" : collectCellText(tc, styles, numbering, footnotes, rels, 0).join("\n");
|
|
18126
|
+
row.push({ col, colSpan, vMerge, text });
|
|
18127
|
+
col += colSpan;
|
|
18128
|
+
}
|
|
18129
|
+
rawRows.push(row);
|
|
18130
|
+
}
|
|
18131
|
+
const cellRows = rawRows.map(
|
|
18132
|
+
(row, r) => row.filter((cell) => cell.vMerge !== "continue").map((cell) => {
|
|
18133
|
+
let rowSpan = 1;
|
|
18134
|
+
if (cell.vMerge === "restart") {
|
|
18135
|
+
for (let nr = r + 1; nr < rawRows.length; nr++) {
|
|
18136
|
+
if (!rawRows[nr].some((nc) => nc.col === cell.col && nc.vMerge === "continue")) break;
|
|
18137
|
+
rowSpan++;
|
|
18138
|
+
}
|
|
18122
18139
|
}
|
|
18123
|
-
|
|
18124
|
-
}
|
|
18125
|
-
|
|
18126
|
-
|
|
18127
|
-
|
|
18128
|
-
|
|
18129
|
-
|
|
18130
|
-
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18140
|
+
return { text: cell.text, colSpan: cell.colSpan, rowSpan, colAddr: cell.col, rowAddr: r };
|
|
18141
|
+
})
|
|
18142
|
+
);
|
|
18143
|
+
const table = buildTable(cellRows);
|
|
18144
|
+
if (table.rows === 0 || table.cols === 0) return null;
|
|
18145
|
+
return { type: "table", table };
|
|
18146
|
+
}
|
|
18147
|
+
function collectCellText(tc, styles, numbering, footnotes, rels, depth) {
|
|
18148
|
+
const parts = [];
|
|
18149
|
+
if (depth > 20) return parts;
|
|
18150
|
+
for (const el of effectiveChildElements(tc)) {
|
|
18151
|
+
if (matchesLocal(el, "p")) {
|
|
18152
|
+
const block = parseParagraph2(el, styles, numbering, footnotes, rels);
|
|
18153
|
+
if (block?.text) parts.push(block.text);
|
|
18154
|
+
for (const tp of collectTextboxParagraphs(el)) {
|
|
18155
|
+
const tb = parseParagraph2(tp, styles, numbering, footnotes, rels);
|
|
18156
|
+
if (tb?.text) parts.push(tb.text);
|
|
18157
|
+
}
|
|
18158
|
+
} else if (matchesLocal(el, "tbl")) {
|
|
18159
|
+
for (const tr of getChildElements(el, "tr")) {
|
|
18160
|
+
for (const nestedTc of getChildElements(tr, "tc")) {
|
|
18161
|
+
parts.push(...collectCellText(nestedTc, styles, numbering, footnotes, rels, depth + 1));
|
|
18162
|
+
}
|
|
18136
18163
|
}
|
|
18137
|
-
cell.rowSpan = span;
|
|
18138
18164
|
}
|
|
18139
18165
|
}
|
|
18140
|
-
|
|
18141
|
-
for (const row of rows) {
|
|
18142
|
-
const clean = row.filter((cell) => cell.rowSpan !== 0);
|
|
18143
|
-
cleanRows.push(clean);
|
|
18144
|
-
}
|
|
18145
|
-
if (cleanRows.length === 0) return null;
|
|
18146
|
-
let cols = 0;
|
|
18147
|
-
for (const row of cleanRows) {
|
|
18148
|
-
let c = 0;
|
|
18149
|
-
for (const cell of row) c += cell.colSpan;
|
|
18150
|
-
if (c > cols) cols = c;
|
|
18151
|
-
}
|
|
18152
|
-
const table = {
|
|
18153
|
-
rows: cleanRows.length,
|
|
18154
|
-
cols,
|
|
18155
|
-
cells: cleanRows,
|
|
18156
|
-
hasHeader: cleanRows.length > 1
|
|
18157
|
-
};
|
|
18158
|
-
return { type: "table", table };
|
|
18166
|
+
return parts;
|
|
18159
18167
|
}
|
|
18160
18168
|
async function extractImages(zip, rels, doc, warnings) {
|
|
18161
18169
|
const blocks = [];
|
|
@@ -18261,6 +18269,10 @@ async function parseDocxDocument(buffer, options) {
|
|
|
18261
18269
|
if (localName2 === "p") {
|
|
18262
18270
|
const block = parseParagraph2(el, styles, numbering, footnotes, rels);
|
|
18263
18271
|
if (block) blocks.push(block);
|
|
18272
|
+
for (const tp of collectTextboxParagraphs(el)) {
|
|
18273
|
+
const tb = parseParagraph2(tp, styles, numbering, footnotes, rels);
|
|
18274
|
+
if (tb) blocks.push(tb);
|
|
18275
|
+
}
|
|
18264
18276
|
} else if (localName2 === "tbl") {
|
|
18265
18277
|
const block = parseTable(el, styles, numbering, footnotes, rels);
|
|
18266
18278
|
if (block) blocks.push(block);
|
|
@@ -18404,6 +18416,7 @@ function walkContent(node, blocks, paraShapeMap, sectionNum, warnings, inHeaderF
|
|
|
18404
18416
|
if (tag === "P") {
|
|
18405
18417
|
if (!inHeaderFooter) {
|
|
18406
18418
|
parseParagraph3(el, blocks, paraShapeMap, sectionNum);
|
|
18419
|
+
walkTablesInP(el, blocks, paraShapeMap, sectionNum, warnings);
|
|
18407
18420
|
}
|
|
18408
18421
|
continue;
|
|
18409
18422
|
}
|
|
@@ -18420,6 +18433,21 @@ function walkContent(node, blocks, paraShapeMap, sectionNum, warnings, inHeaderF
|
|
|
18420
18433
|
walkContent(el, blocks, paraShapeMap, sectionNum, warnings, inHeaderFooter, depth + 1);
|
|
18421
18434
|
}
|
|
18422
18435
|
}
|
|
18436
|
+
function walkTablesInP(node, blocks, paraShapeMap, sectionNum, warnings, depth = 0) {
|
|
18437
|
+
if (depth > MAX_XML_DEPTH2) return;
|
|
18438
|
+
const children = node.childNodes;
|
|
18439
|
+
for (let i = 0; i < children.length; i++) {
|
|
18440
|
+
const el = children[i];
|
|
18441
|
+
if (el.nodeType !== 1) continue;
|
|
18442
|
+
const tag = localName(el);
|
|
18443
|
+
if (tag === "TABLE") {
|
|
18444
|
+
parseTable2(el, blocks, paraShapeMap, sectionNum, warnings);
|
|
18445
|
+
continue;
|
|
18446
|
+
}
|
|
18447
|
+
if (tag === "FOOTNOTE" || tag === "ENDNOTE" || tag === "HEADER" || tag === "FOOTER") continue;
|
|
18448
|
+
walkTablesInP(el, blocks, paraShapeMap, sectionNum, warnings, depth + 1);
|
|
18449
|
+
}
|
|
18450
|
+
}
|
|
18423
18451
|
function parseParagraph3(el, blocks, paraShapeMap, sectionNum) {
|
|
18424
18452
|
const paraShapeId = el.getAttribute("ParaShape") ?? "";
|
|
18425
18453
|
const shapeInfo = paraShapeMap.get(paraShapeId);
|
|
@@ -18502,10 +18530,10 @@ function parseTable2(el, blocks, paraShapeMap, sectionNum, warnings) {
|
|
|
18502
18530
|
}
|
|
18503
18531
|
function extractCellText(cellEl) {
|
|
18504
18532
|
const textParts = [];
|
|
18505
|
-
|
|
18533
|
+
collectCellText2(cellEl, textParts, 0);
|
|
18506
18534
|
return textParts.filter(Boolean).join("\n").trim();
|
|
18507
18535
|
}
|
|
18508
|
-
function
|
|
18536
|
+
function collectCellText2(node, parts, depth) {
|
|
18509
18537
|
if (depth > 20) return;
|
|
18510
18538
|
const children = node.childNodes;
|
|
18511
18539
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -18515,13 +18543,29 @@ function collectCellText(node, parts, depth) {
|
|
|
18515
18543
|
if (tag === "P") {
|
|
18516
18544
|
const t = extractParagraphText(el);
|
|
18517
18545
|
if (t) parts.push(t);
|
|
18546
|
+
collectNestedTableText(el, parts, depth + 1);
|
|
18518
18547
|
} else if (tag === "TABLE") {
|
|
18519
|
-
|
|
18548
|
+
collectCellText2(el, parts, depth + 1);
|
|
18520
18549
|
} else {
|
|
18521
|
-
|
|
18550
|
+
collectCellText2(el, parts, depth + 1);
|
|
18522
18551
|
}
|
|
18523
18552
|
}
|
|
18524
18553
|
}
|
|
18554
|
+
function collectNestedTableText(node, parts, depth) {
|
|
18555
|
+
if (depth > 20) return;
|
|
18556
|
+
const children = node.childNodes;
|
|
18557
|
+
for (let i = 0; i < children.length; i++) {
|
|
18558
|
+
const el = children[i];
|
|
18559
|
+
if (el.nodeType !== 1) continue;
|
|
18560
|
+
const tag = localName(el);
|
|
18561
|
+
if (tag === "TABLE") {
|
|
18562
|
+
collectCellText2(el, parts, depth + 1);
|
|
18563
|
+
continue;
|
|
18564
|
+
}
|
|
18565
|
+
if (tag === "FOOTNOTE" || tag === "ENDNOTE" || tag === "HEADER" || tag === "FOOTER") continue;
|
|
18566
|
+
collectNestedTableText(el, parts, depth + 1);
|
|
18567
|
+
}
|
|
18568
|
+
}
|
|
18525
18569
|
function localName(el) {
|
|
18526
18570
|
return (el.tagName || el.localName || "").replace(/^[^:]+:/, "");
|
|
18527
18571
|
}
|
|
@@ -20474,12 +20518,13 @@ function charPr(id, height, bold, italic, fontId = 0, textColor = DEFAULT_TEXT_C
|
|
|
20474
20518
|
</hh:charPr>`;
|
|
20475
20519
|
}
|
|
20476
20520
|
function paraPr(id, opts = {}) {
|
|
20477
|
-
const { align = "JUSTIFY", spaceBefore = 0, spaceAfter = 0, lineSpacing = 160, indent = 0, left = 0, keepWord = false } = opts;
|
|
20521
|
+
const { align = "JUSTIFY", spaceBefore = 0, spaceAfter = 0, lineSpacing = 160, indent = 0, left = 0, keepWord = false, outlineLevel } = opts;
|
|
20478
20522
|
const breakNonLatin = keepWord ? "KEEP_WORD" : "BREAK_WORD";
|
|
20479
20523
|
const snapGrid = keepWord ? "0" : "1";
|
|
20524
|
+
const heading = outlineLevel !== void 0 ? `<hh:heading type="OUTLINE" idRef="0" level="${outlineLevel}"/>` : `<hh:heading type="NONE" idRef="0" level="0"/>`;
|
|
20480
20525
|
return ` <hh:paraPr id="${id}" tabPrIDRef="0" condense="0" fontLineHeight="0" snapToGrid="${snapGrid}" suppressLineNumbers="0" checked="0" textDir="AUTO">
|
|
20481
20526
|
<hh:align horizontal="${align}" vertical="BASELINE"/>
|
|
20482
|
-
|
|
20527
|
+
${heading}
|
|
20483
20528
|
<hh:breakSetting breakLatinWord="KEEP_WORD" breakNonLatinWord="${breakNonLatin}" widowOrphan="0" keepWithNext="0" keepLines="0" pageBreakBefore="0" lineWrap="BREAK"/>
|
|
20484
20529
|
<hh:autoSpacing eAsianEng="0" eAsianNum="0"/>
|
|
20485
20530
|
<hh:margin><hc:intent value="${indent}" unit="HWPUNIT"/><hc:left value="${left}" unit="HWPUNIT"/><hc:right value="0" unit="HWPUNIT"/><hc:prev value="${spaceBefore}" unit="HWPUNIT"/><hc:next value="${spaceAfter}" unit="HWPUNIT"/></hh:margin>
|
|
@@ -20586,7 +20631,7 @@ function parseMarkdownToBlocks(md2) {
|
|
|
20586
20631
|
if (listMatch) {
|
|
20587
20632
|
const indent = Math.floor(listMatch[1].length / 2);
|
|
20588
20633
|
const ordered = /\d/.test(listMatch[2]);
|
|
20589
|
-
blocks.push({ type: "list_item", text: listMatch[3].trim(), ordered, indent });
|
|
20634
|
+
blocks.push({ type: "list_item", text: listMatch[3].trim(), ordered, indent, marker: listMatch[2] });
|
|
20590
20635
|
i++;
|
|
20591
20636
|
continue;
|
|
20592
20637
|
}
|
|
@@ -20596,6 +20641,11 @@ function parseMarkdownToBlocks(md2) {
|
|
|
20596
20641
|
return blocks;
|
|
20597
20642
|
}
|
|
20598
20643
|
function parseInlineMarkdown(text) {
|
|
20644
|
+
const literals = [];
|
|
20645
|
+
text = text.replace(/\x00/g, "").replace(/\\([\\`*_{}[\]()#+\-.!|>~])/g, (_, c) => {
|
|
20646
|
+
literals.push(c);
|
|
20647
|
+
return `\0${literals.length - 1}\0`;
|
|
20648
|
+
});
|
|
20599
20649
|
text = text.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1");
|
|
20600
20650
|
text = text.replace(/\[([^\]]*)\]\(([^)]*)\)/g, (_, t, u) => t || u);
|
|
20601
20651
|
text = text.replace(/~~([^~]+)~~/g, "$1");
|
|
@@ -20625,6 +20675,13 @@ function parseInlineMarkdown(text) {
|
|
|
20625
20675
|
if (spans.length === 0) {
|
|
20626
20676
|
spans.push({ text, bold: false, italic: false, code: false });
|
|
20627
20677
|
}
|
|
20678
|
+
for (const span of spans) {
|
|
20679
|
+
if (!span.text.includes("\0")) continue;
|
|
20680
|
+
span.text = span.text.replace(/\x00(\d+)\x00/g, (_, i) => {
|
|
20681
|
+
const c = literals[+i] ?? "";
|
|
20682
|
+
return span.code ? "\\" + c : c;
|
|
20683
|
+
});
|
|
20684
|
+
}
|
|
20628
20685
|
return spans;
|
|
20629
20686
|
}
|
|
20630
20687
|
function spanToCharPrId(span) {
|
|
@@ -20712,10 +20769,10 @@ function buildParaProperties(gongmun) {
|
|
|
20712
20769
|
if (!gongmun) {
|
|
20713
20770
|
const base2 = [
|
|
20714
20771
|
paraPr(0),
|
|
20715
|
-
paraPr(1, { align: "LEFT", spaceBefore: 800, spaceAfter: 200, lineSpacing: 180 }),
|
|
20716
|
-
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: 170 }),
|
|
20717
|
-
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: 160 }),
|
|
20718
|
-
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: 160 }),
|
|
20772
|
+
paraPr(1, { align: "LEFT", spaceBefore: 800, spaceAfter: 200, lineSpacing: 180, outlineLevel: 0 }),
|
|
20773
|
+
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: 170, outlineLevel: 1 }),
|
|
20774
|
+
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: 160, outlineLevel: 2 }),
|
|
20775
|
+
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: 160, outlineLevel: 3 }),
|
|
20719
20776
|
paraPr(5, { align: "LEFT", lineSpacing: 130, indent: 400 }),
|
|
20720
20777
|
paraPr(6, { align: "LEFT", lineSpacing: 150, indent: 600 }),
|
|
20721
20778
|
paraPr(7, { align: "LEFT", lineSpacing: 160, indent: 600 })
|
|
@@ -20728,10 +20785,10 @@ ${base2.join("\n")}
|
|
|
20728
20785
|
const titleAlign = gongmun.centerTitle ? "CENTER" : "LEFT";
|
|
20729
20786
|
const base = [
|
|
20730
20787
|
paraPr(0, { lineSpacing: ls, keepWord: true }),
|
|
20731
|
-
paraPr(1, { align: titleAlign, spaceBefore: 400, spaceAfter: 400, lineSpacing: ls, keepWord: true }),
|
|
20732
|
-
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: ls, keepWord: true }),
|
|
20733
|
-
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: ls, keepWord: true }),
|
|
20734
|
-
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: ls, keepWord: true }),
|
|
20788
|
+
paraPr(1, { align: titleAlign, spaceBefore: 400, spaceAfter: 400, lineSpacing: ls, keepWord: true, outlineLevel: 0 }),
|
|
20789
|
+
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: ls, keepWord: true, outlineLevel: 1 }),
|
|
20790
|
+
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: ls, keepWord: true, outlineLevel: 2 }),
|
|
20791
|
+
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: ls, keepWord: true, outlineLevel: 3 }),
|
|
20735
20792
|
paraPr(5, { align: "LEFT", lineSpacing: 130, indent: 400, keepWord: true }),
|
|
20736
20793
|
paraPr(6, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true }),
|
|
20737
20794
|
paraPr(7, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true })
|
|
@@ -20746,6 +20803,17 @@ ${base2.join("\n")}
|
|
|
20746
20803
|
${base.join("\n")}
|
|
20747
20804
|
</hh:paraProperties>`;
|
|
20748
20805
|
}
|
|
20806
|
+
function buildNumberings() {
|
|
20807
|
+
const heads = Array.from(
|
|
20808
|
+
{ length: 7 },
|
|
20809
|
+
(_, i) => ` <hh:paraHead start="1" level="${i + 1}" align="LEFT" useInstWidth="1" autoIndent="1" widthAdjust="0" textOffsetType="PERCENT" textOffset="50" numFormat="DIGIT" charPrIDRef="4294967295" checkable="0"/>`
|
|
20810
|
+
).join("\n");
|
|
20811
|
+
return `<hh:numberings itemCnt="1">
|
|
20812
|
+
<hh:numbering id="1" start="0">
|
|
20813
|
+
${heads}
|
|
20814
|
+
</hh:numbering>
|
|
20815
|
+
</hh:numberings>`;
|
|
20816
|
+
}
|
|
20749
20817
|
function generateHeaderXml(theme, gongmun, ratioVariants = []) {
|
|
20750
20818
|
const bodyFace = gongmun?.bodyFont === "gothic" ? "\uB9D1\uC740 \uACE0\uB515" : "\uD568\uCD08\uB86C\uBC14\uD0D5";
|
|
20751
20819
|
const charPropsXml = buildCharProperties(theme, gongmun, ratioVariants);
|
|
@@ -20823,7 +20891,7 @@ function generateHeaderXml(theme, gongmun, ratioVariants = []) {
|
|
|
20823
20891
|
</hh:borderFills>
|
|
20824
20892
|
${charPropsXml}
|
|
20825
20893
|
<hh:tabProperties itemCnt="0"/>
|
|
20826
|
-
|
|
20894
|
+
${buildNumberings()}
|
|
20827
20895
|
<hh:bullets itemCnt="0"/>
|
|
20828
20896
|
${paraPropsXml}
|
|
20829
20897
|
<hh:styles itemCnt="1">
|
|
@@ -21088,7 +21156,7 @@ function bestSimInRange(arr, from, to, target) {
|
|
|
21088
21156
|
return best;
|
|
21089
21157
|
}
|
|
21090
21158
|
function escapeGfm(text) {
|
|
21091
|
-
return text.replace(
|
|
21159
|
+
return text.replace(/([~*])/g, "\\$1");
|
|
21092
21160
|
}
|
|
21093
21161
|
var HWP_SHAPE_ALT_TEXT_RE = /(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|이등변 삼각형|직각 삼각형|선|직선|곡선|화살표|굵은 화살표|이중 화살표|오각형|육각형|팔각형|별|[4-8]점별|십자|십자형|구름|구름형|마름모|도넛|평행사변형|사다리꼴|부채꼴|호|반원|물결|번개|하트|빗금|블록 화살표|수식|표|그림|개체|그리기\s?개체|묶음\s?개체|글상자|수식\s?개체|OLE\s?개체)\s?입니다\.?/g;
|
|
21094
21162
|
function sanitizeText(text) {
|
|
@@ -21106,7 +21174,7 @@ function normForMatch(text) {
|
|
|
21106
21174
|
return sanitizeText(text).replace(/\s+/g, " ").trim();
|
|
21107
21175
|
}
|
|
21108
21176
|
function unescapeGfm(text) {
|
|
21109
|
-
return text.replace(
|
|
21177
|
+
return text.replace(/\\([~*])/g, "$1");
|
|
21110
21178
|
}
|
|
21111
21179
|
function summarize(text) {
|
|
21112
21180
|
const t = text.replace(/\s+/g, " ").trim();
|
|
@@ -21173,7 +21241,7 @@ function parseGfmTable(lines) {
|
|
|
21173
21241
|
return rows;
|
|
21174
21242
|
}
|
|
21175
21243
|
function unescapeGfmCell(text) {
|
|
21176
|
-
return text.replace(/<br\s*\/?>/gi, "\n").replace(/\\\|/g, "|").replace(
|
|
21244
|
+
return text.replace(/<br\s*\/?>/gi, "\n").replace(/\\\|/g, "|").replace(/\\([~*])/g, "$1");
|
|
21177
21245
|
}
|
|
21178
21246
|
function replicateCellInnerHtml(cell) {
|
|
21179
21247
|
if (cell.blocks?.length) {
|
|
@@ -21432,7 +21500,7 @@ function generateSecPr(gongmun) {
|
|
|
21432
21500
|
header: 0,
|
|
21433
21501
|
footer: 0
|
|
21434
21502
|
} : { top: 8504, bottom: 4252, left: 5670, right: 4252, header: 2835, footer: 2835 };
|
|
21435
|
-
return `<hp:secPr textDirection="HORIZONTAL" spaceColumns="1134" tabStop="8000" outlineShapeIDRef="
|
|
21503
|
+
return `<hp:secPr textDirection="HORIZONTAL" spaceColumns="1134" tabStop="8000" outlineShapeIDRef="1" memoShapeIDRef="0" textVerticalWidthHead="0" masterPageCnt="0"><hp:grid lineGrid="0" charGrid="0" wonggojiFormat="0"/><hp:startNum pageStartsOn="BOTH" page="0" pic="0" tbl="0" equation="0"/><hp:visibility hideFirstHeader="0" hideFirstFooter="0" hideFirstMasterPage="0" border="SHOW_ALL" fill="SHOW_ALL" hideFirstPageNum="0" hideFirstEmptyLine="0" showLineNumber="0"/><hp:pagePr landscape="WIDELY" width="59528" height="84188" gutterType="LEFT_ONLY"><hp:margin header="${m.header}" footer="${m.footer}" gutter="0" left="${m.left}" right="${m.right}" top="${m.top}" bottom="${m.bottom}"/></hp:pagePr><hp:footNotePr><hp:autoNumFormat type="DIGIT" userChar="" prefixChar="" suffixChar=")" supscript="0"/><hp:noteLine length="-1" type="SOLID" width="0.12 mm" color="#000000"/><hp:noteSpacing betweenNotes="283" belowLine="567" aboveLine="850"/><hp:numbering type="CONTINUOUS" newNum="1"/><hp:placement place="EACH_COLUMN" beneathText="0"/></hp:footNotePr><hp:endNotePr><hp:autoNumFormat type="DIGIT" userChar="" prefixChar="" suffixChar=")" supscript="0"/><hp:noteLine length="14692344" type="SOLID" width="0.12 mm" color="#000000"/><hp:noteSpacing betweenNotes="0" belowLine="567" aboveLine="850"/><hp:numbering type="CONTINUOUS" newNum="1"/><hp:placement place="END_OF_DOCUMENT" beneathText="0"/></hp:endNotePr></hp:secPr>`;
|
|
21436
21504
|
}
|
|
21437
21505
|
function blocksToSectionXml(blocks, theme, gongmun, gongmunList = gongmun ? precomputeGongmunList(blocks, gongmun) : null, fit = null) {
|
|
21438
21506
|
const paraXmls = [];
|
|
@@ -21489,7 +21557,10 @@ function blocksToSectionXml(blocks, theme, gongmun, gongmunList = gongmun ? prec
|
|
|
21489
21557
|
}
|
|
21490
21558
|
const indent = block.indent || 0;
|
|
21491
21559
|
let marker;
|
|
21492
|
-
if (block.
|
|
21560
|
+
if (block.marker) {
|
|
21561
|
+
marker = `${block.marker} `;
|
|
21562
|
+
prevWasOrdered = !!block.ordered;
|
|
21563
|
+
} else if (block.ordered) {
|
|
21493
21564
|
orderedCounters[indent] = (orderedCounters[indent] || 0) + 1;
|
|
21494
21565
|
for (const k of Object.keys(orderedCounters)) {
|
|
21495
21566
|
if (+k > indent) delete orderedCounters[+k];
|
|
@@ -24297,7 +24368,7 @@ async function parseHwp(buffer, options) {
|
|
|
24297
24368
|
async function parsePdf(buffer, options) {
|
|
24298
24369
|
let parsePdfDocument;
|
|
24299
24370
|
try {
|
|
24300
|
-
const mod = await import("./parser-
|
|
24371
|
+
const mod = await import("./parser-PR7CPMM4.js");
|
|
24301
24372
|
parsePdfDocument = mod.parsePdfDocument;
|
|
24302
24373
|
} catch {
|
|
24303
24374
|
return {
|
|
@@ -24432,4 +24503,4 @@ export {
|
|
|
24432
24503
|
parseHwpml,
|
|
24433
24504
|
fillForm
|
|
24434
24505
|
};
|
|
24435
|
-
//# sourceMappingURL=chunk-
|
|
24506
|
+
//# sourceMappingURL=chunk-6EDNKPXQ.js.map
|