kordoc 3.8.3 → 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 +7 -0
- package/dist/{-F5IXBLQQ.js → -ZAIG6FWT.js} +3 -3
- package/dist/{chunk-KIWKBRCJ.js → chunk-2UDAEQPW.js} +3 -3
- package/dist/chunk-2UDAEQPW.js.map +1 -0
- package/dist/{chunk-B27QMVL7.js → chunk-6EDNKPXQ.js} +112 -76
- package/dist/chunk-6EDNKPXQ.js.map +1 -0
- package/dist/{chunk-7J73IGMK.js → chunk-T4SGNVVS.js} +3 -3
- package/dist/chunk-T4SGNVVS.js.map +1 -0
- package/dist/{chunk-XL6O3VAY.cjs → chunk-Z3O36LBJ.cjs} +3 -3
- package/dist/{chunk-XL6O3VAY.cjs.map → chunk-Z3O36LBJ.cjs.map} +1 -1
- package/dist/cli.js +4 -4
- package/dist/index.cjs +366 -330
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +111 -75
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +3 -3
- package/dist/{parser-TM3AS25T.js → parser-2THIF623.js} +2 -2
- package/dist/{parser-6GP535ZB.js → parser-PR7CPMM4.js} +2 -2
- package/dist/{parser-WWKYMRGJ.cjs → parser-ZVKCFXR3.cjs} +14 -14
- package/dist/{parser-WWKYMRGJ.cjs.map → parser-ZVKCFXR3.cjs.map} +1 -1
- package/dist/{watch-HETTZ7BO.js → watch-2HYPNMOB.js} +3 -3
- package/package.json +2 -2
- package/dist/chunk-7J73IGMK.js.map +0 -1
- package/dist/chunk-B27QMVL7.js.map +0 -1
- package/dist/chunk-KIWKBRCJ.js.map +0 -1
- /package/dist/{-F5IXBLQQ.js.map → -ZAIG6FWT.js.map} +0 -0
- /package/dist/{parser-TM3AS25T.js.map → parser-2THIF623.js.map} +0 -0
- /package/dist/{parser-6GP535ZB.js.map → parser-PR7CPMM4.js.map} +0 -0
- /package/dist/{watch-HETTZ7BO.js.map → watch-2HYPNMOB.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
sanitizeHref,
|
|
20
20
|
stripDtd,
|
|
21
21
|
toArrayBuffer
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-T4SGNVVS.js";
|
|
23
23
|
import {
|
|
24
24
|
parsePageRange
|
|
25
25
|
} from "./chunk-GE43BE46.js";
|
|
@@ -1150,14 +1150,14 @@ function resolveParaHeading(paraEl, ctx) {
|
|
|
1150
1150
|
const head = numDef.heads.get(level);
|
|
1151
1151
|
counters[level] = counters[level] === 0 ? head?.start ?? 1 : counters[level] + 1;
|
|
1152
1152
|
for (let l = level + 1; l <= 10; l++) counters[l] = 0;
|
|
1153
|
-
const fmtText = head
|
|
1153
|
+
const fmtText = head ? head.text.trim() : `^${level}.`;
|
|
1154
1154
|
const prefix = fmtText.replace(/\^(10|[1-9])/g, (_, d) => {
|
|
1155
1155
|
const lv = parseInt(d, 10);
|
|
1156
1156
|
const refHead = numDef.heads.get(lv);
|
|
1157
1157
|
const n = counters[lv] || refHead?.start || 1;
|
|
1158
1158
|
return formatHeadNumber(n, refHead?.numFormat || "DIGIT");
|
|
1159
1159
|
});
|
|
1160
|
-
return { prefix, headingLevel };
|
|
1160
|
+
return { prefix: prefix || void 0, headingLevel };
|
|
1161
1161
|
}
|
|
1162
1162
|
|
|
1163
1163
|
// src/hwpx/table-build.ts
|
|
@@ -18309,74 +18309,79 @@ function parseParagraph2(p, styles, numbering, footnotes, rels) {
|
|
|
18309
18309
|
if (footnoteText) block.footnoteText = footnoteText;
|
|
18310
18310
|
return block;
|
|
18311
18311
|
}
|
|
18312
|
+
function collectTextboxParagraphs(node, inTxbx = false, out = [], depth = 0) {
|
|
18313
|
+
if (depth > 40) return out;
|
|
18314
|
+
for (const el of effectiveChildElements(node)) {
|
|
18315
|
+
if (matchesLocal(el, "Fallback")) continue;
|
|
18316
|
+
const nowIn = inTxbx || matchesLocal(el, "txbxContent");
|
|
18317
|
+
if (nowIn && matchesLocal(el, "p")) out.push(el);
|
|
18318
|
+
collectTextboxParagraphs(el, nowIn, out, depth + 1);
|
|
18319
|
+
}
|
|
18320
|
+
return out;
|
|
18321
|
+
}
|
|
18312
18322
|
function parseTable(tbl, styles, numbering, footnotes, rels) {
|
|
18313
18323
|
const trElements = getChildElements(tbl, "tr");
|
|
18314
18324
|
if (trElements.length === 0) return null;
|
|
18315
|
-
const
|
|
18316
|
-
let maxCols = 0;
|
|
18325
|
+
const rawRows = [];
|
|
18317
18326
|
for (const tr of trElements) {
|
|
18318
|
-
const tcElements = getChildElements(tr, "tc");
|
|
18319
18327
|
const row = [];
|
|
18320
|
-
|
|
18328
|
+
let col = 0;
|
|
18329
|
+
for (const tc of getChildElements(tr, "tc")) {
|
|
18321
18330
|
let colSpan = 1;
|
|
18322
|
-
let
|
|
18331
|
+
let vMerge = null;
|
|
18323
18332
|
const tcPrEls = getChildElements(tc, "tcPr");
|
|
18324
18333
|
if (tcPrEls.length > 0) {
|
|
18325
18334
|
const gridSpanEls = getChildElements(tcPrEls[0], "gridSpan");
|
|
18326
18335
|
if (gridSpanEls.length > 0) {
|
|
18327
|
-
colSpan = parseInt(getAttr(gridSpanEls[0], "val") ?? "1", 10);
|
|
18336
|
+
colSpan = parseInt(getAttr(gridSpanEls[0], "val") ?? "1", 10) || 1;
|
|
18328
18337
|
}
|
|
18329
18338
|
const vMergeEls = getChildElements(tcPrEls[0], "vMerge");
|
|
18330
18339
|
if (vMergeEls.length > 0) {
|
|
18331
|
-
|
|
18332
|
-
|
|
18333
|
-
|
|
18334
|
-
|
|
18335
|
-
|
|
18340
|
+
vMerge = getAttr(vMergeEls[0], "val") === "restart" ? "restart" : "continue";
|
|
18341
|
+
}
|
|
18342
|
+
}
|
|
18343
|
+
const text = vMerge === "continue" ? "" : collectCellText(tc, styles, numbering, footnotes, rels, 0).join("\n");
|
|
18344
|
+
row.push({ col, colSpan, vMerge, text });
|
|
18345
|
+
col += colSpan;
|
|
18346
|
+
}
|
|
18347
|
+
rawRows.push(row);
|
|
18348
|
+
}
|
|
18349
|
+
const cellRows = rawRows.map(
|
|
18350
|
+
(row, r) => row.filter((cell) => cell.vMerge !== "continue").map((cell) => {
|
|
18351
|
+
let rowSpan = 1;
|
|
18352
|
+
if (cell.vMerge === "restart") {
|
|
18353
|
+
for (let nr = r + 1; nr < rawRows.length; nr++) {
|
|
18354
|
+
if (!rawRows[nr].some((nc) => nc.col === cell.col && nc.vMerge === "continue")) break;
|
|
18355
|
+
rowSpan++;
|
|
18336
18356
|
}
|
|
18337
18357
|
}
|
|
18338
|
-
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
|
|
18358
|
+
return { text: cell.text, colSpan: cell.colSpan, rowSpan, colAddr: cell.col, rowAddr: r };
|
|
18359
|
+
})
|
|
18360
|
+
);
|
|
18361
|
+
const table = buildTable(cellRows);
|
|
18362
|
+
if (table.rows === 0 || table.cols === 0) return null;
|
|
18363
|
+
return { type: "table", table };
|
|
18364
|
+
}
|
|
18365
|
+
function collectCellText(tc, styles, numbering, footnotes, rels, depth) {
|
|
18366
|
+
const parts = [];
|
|
18367
|
+
if (depth > 20) return parts;
|
|
18368
|
+
for (const el of effectiveChildElements(tc)) {
|
|
18369
|
+
if (matchesLocal(el, "p")) {
|
|
18370
|
+
const block = parseParagraph2(el, styles, numbering, footnotes, rels);
|
|
18371
|
+
if (block?.text) parts.push(block.text);
|
|
18372
|
+
for (const tp of collectTextboxParagraphs(el)) {
|
|
18373
|
+
const tb = parseParagraph2(tp, styles, numbering, footnotes, rels);
|
|
18374
|
+
if (tb?.text) parts.push(tb.text);
|
|
18343
18375
|
}
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
|
|
18347
|
-
|
|
18348
|
-
|
|
18349
|
-
for (let c = 0; c < maxCols; c++) {
|
|
18350
|
-
for (let r = 0; r < rows.length; r++) {
|
|
18351
|
-
const cell = rows[r][c];
|
|
18352
|
-
if (!cell || cell.rowSpan === 0) continue;
|
|
18353
|
-
let span = 1;
|
|
18354
|
-
for (let nr = r + 1; nr < rows.length; nr++) {
|
|
18355
|
-
if (rows[nr][c]?.rowSpan === 0) span++;
|
|
18356
|
-
else break;
|
|
18376
|
+
} else if (matchesLocal(el, "tbl")) {
|
|
18377
|
+
for (const tr of getChildElements(el, "tr")) {
|
|
18378
|
+
for (const nestedTc of getChildElements(tr, "tc")) {
|
|
18379
|
+
parts.push(...collectCellText(nestedTc, styles, numbering, footnotes, rels, depth + 1));
|
|
18380
|
+
}
|
|
18357
18381
|
}
|
|
18358
|
-
cell.rowSpan = span;
|
|
18359
18382
|
}
|
|
18360
18383
|
}
|
|
18361
|
-
|
|
18362
|
-
for (const row of rows) {
|
|
18363
|
-
const clean = row.filter((cell) => cell.rowSpan !== 0);
|
|
18364
|
-
cleanRows.push(clean);
|
|
18365
|
-
}
|
|
18366
|
-
if (cleanRows.length === 0) return null;
|
|
18367
|
-
let cols = 0;
|
|
18368
|
-
for (const row of cleanRows) {
|
|
18369
|
-
let c = 0;
|
|
18370
|
-
for (const cell of row) c += cell.colSpan;
|
|
18371
|
-
if (c > cols) cols = c;
|
|
18372
|
-
}
|
|
18373
|
-
const table = {
|
|
18374
|
-
rows: cleanRows.length,
|
|
18375
|
-
cols,
|
|
18376
|
-
cells: cleanRows,
|
|
18377
|
-
hasHeader: cleanRows.length > 1
|
|
18378
|
-
};
|
|
18379
|
-
return { type: "table", table };
|
|
18384
|
+
return parts;
|
|
18380
18385
|
}
|
|
18381
18386
|
async function extractImages(zip, rels, doc, warnings) {
|
|
18382
18387
|
const blocks = [];
|
|
@@ -18482,6 +18487,10 @@ async function parseDocxDocument(buffer, options) {
|
|
|
18482
18487
|
if (localName2 === "p") {
|
|
18483
18488
|
const block = parseParagraph2(el, styles, numbering, footnotes, rels);
|
|
18484
18489
|
if (block) blocks.push(block);
|
|
18490
|
+
for (const tp of collectTextboxParagraphs(el)) {
|
|
18491
|
+
const tb = parseParagraph2(tp, styles, numbering, footnotes, rels);
|
|
18492
|
+
if (tb) blocks.push(tb);
|
|
18493
|
+
}
|
|
18485
18494
|
} else if (localName2 === "tbl") {
|
|
18486
18495
|
const block = parseTable(el, styles, numbering, footnotes, rels);
|
|
18487
18496
|
if (block) blocks.push(block);
|
|
@@ -18739,10 +18748,10 @@ function parseTable2(el, blocks, paraShapeMap, sectionNum, warnings) {
|
|
|
18739
18748
|
}
|
|
18740
18749
|
function extractCellText(cellEl) {
|
|
18741
18750
|
const textParts = [];
|
|
18742
|
-
|
|
18751
|
+
collectCellText2(cellEl, textParts, 0);
|
|
18743
18752
|
return textParts.filter(Boolean).join("\n").trim();
|
|
18744
18753
|
}
|
|
18745
|
-
function
|
|
18754
|
+
function collectCellText2(node, parts, depth) {
|
|
18746
18755
|
if (depth > 20) return;
|
|
18747
18756
|
const children = node.childNodes;
|
|
18748
18757
|
for (let i = 0; i < children.length; i++) {
|
|
@@ -18754,9 +18763,9 @@ function collectCellText(node, parts, depth) {
|
|
|
18754
18763
|
if (t) parts.push(t);
|
|
18755
18764
|
collectNestedTableText(el, parts, depth + 1);
|
|
18756
18765
|
} else if (tag === "TABLE") {
|
|
18757
|
-
|
|
18766
|
+
collectCellText2(el, parts, depth + 1);
|
|
18758
18767
|
} else {
|
|
18759
|
-
|
|
18768
|
+
collectCellText2(el, parts, depth + 1);
|
|
18760
18769
|
}
|
|
18761
18770
|
}
|
|
18762
18771
|
}
|
|
@@ -18768,7 +18777,7 @@ function collectNestedTableText(node, parts, depth) {
|
|
|
18768
18777
|
if (el.nodeType !== 1) continue;
|
|
18769
18778
|
const tag = localName(el);
|
|
18770
18779
|
if (tag === "TABLE") {
|
|
18771
|
-
|
|
18780
|
+
collectCellText2(el, parts, depth + 1);
|
|
18772
18781
|
continue;
|
|
18773
18782
|
}
|
|
18774
18783
|
if (tag === "FOOTNOTE" || tag === "ENDNOTE" || tag === "HEADER" || tag === "FOOTER") continue;
|
|
@@ -20727,12 +20736,13 @@ function charPr(id, height, bold, italic, fontId = 0, textColor = DEFAULT_TEXT_C
|
|
|
20727
20736
|
</hh:charPr>`;
|
|
20728
20737
|
}
|
|
20729
20738
|
function paraPr(id, opts = {}) {
|
|
20730
|
-
const { align = "JUSTIFY", spaceBefore = 0, spaceAfter = 0, lineSpacing = 160, indent = 0, left = 0, keepWord = false } = opts;
|
|
20739
|
+
const { align = "JUSTIFY", spaceBefore = 0, spaceAfter = 0, lineSpacing = 160, indent = 0, left = 0, keepWord = false, outlineLevel } = opts;
|
|
20731
20740
|
const breakNonLatin = keepWord ? "KEEP_WORD" : "BREAK_WORD";
|
|
20732
20741
|
const snapGrid = keepWord ? "0" : "1";
|
|
20742
|
+
const heading = outlineLevel !== void 0 ? `<hh:heading type="OUTLINE" idRef="0" level="${outlineLevel}"/>` : `<hh:heading type="NONE" idRef="0" level="0"/>`;
|
|
20733
20743
|
return ` <hh:paraPr id="${id}" tabPrIDRef="0" condense="0" fontLineHeight="0" snapToGrid="${snapGrid}" suppressLineNumbers="0" checked="0" textDir="AUTO">
|
|
20734
20744
|
<hh:align horizontal="${align}" vertical="BASELINE"/>
|
|
20735
|
-
|
|
20745
|
+
${heading}
|
|
20736
20746
|
<hh:breakSetting breakLatinWord="KEEP_WORD" breakNonLatinWord="${breakNonLatin}" widowOrphan="0" keepWithNext="0" keepLines="0" pageBreakBefore="0" lineWrap="BREAK"/>
|
|
20737
20747
|
<hh:autoSpacing eAsianEng="0" eAsianNum="0"/>
|
|
20738
20748
|
<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>
|
|
@@ -20839,7 +20849,7 @@ function parseMarkdownToBlocks(md2) {
|
|
|
20839
20849
|
if (listMatch) {
|
|
20840
20850
|
const indent = Math.floor(listMatch[1].length / 2);
|
|
20841
20851
|
const ordered = /\d/.test(listMatch[2]);
|
|
20842
|
-
blocks.push({ type: "list_item", text: listMatch[3].trim(), ordered, indent });
|
|
20852
|
+
blocks.push({ type: "list_item", text: listMatch[3].trim(), ordered, indent, marker: listMatch[2] });
|
|
20843
20853
|
i++;
|
|
20844
20854
|
continue;
|
|
20845
20855
|
}
|
|
@@ -20849,6 +20859,11 @@ function parseMarkdownToBlocks(md2) {
|
|
|
20849
20859
|
return blocks;
|
|
20850
20860
|
}
|
|
20851
20861
|
function parseInlineMarkdown(text) {
|
|
20862
|
+
const literals = [];
|
|
20863
|
+
text = text.replace(/\x00/g, "").replace(/\\([\\`*_{}[\]()#+\-.!|>~])/g, (_, c) => {
|
|
20864
|
+
literals.push(c);
|
|
20865
|
+
return `\0${literals.length - 1}\0`;
|
|
20866
|
+
});
|
|
20852
20867
|
text = text.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1");
|
|
20853
20868
|
text = text.replace(/\[([^\]]*)\]\(([^)]*)\)/g, (_, t, u) => t || u);
|
|
20854
20869
|
text = text.replace(/~~([^~]+)~~/g, "$1");
|
|
@@ -20878,6 +20893,13 @@ function parseInlineMarkdown(text) {
|
|
|
20878
20893
|
if (spans.length === 0) {
|
|
20879
20894
|
spans.push({ text, bold: false, italic: false, code: false });
|
|
20880
20895
|
}
|
|
20896
|
+
for (const span of spans) {
|
|
20897
|
+
if (!span.text.includes("\0")) continue;
|
|
20898
|
+
span.text = span.text.replace(/\x00(\d+)\x00/g, (_, i) => {
|
|
20899
|
+
const c = literals[+i] ?? "";
|
|
20900
|
+
return span.code ? "\\" + c : c;
|
|
20901
|
+
});
|
|
20902
|
+
}
|
|
20881
20903
|
return spans;
|
|
20882
20904
|
}
|
|
20883
20905
|
function spanToCharPrId(span) {
|
|
@@ -20965,10 +20987,10 @@ function buildParaProperties(gongmun) {
|
|
|
20965
20987
|
if (!gongmun) {
|
|
20966
20988
|
const base2 = [
|
|
20967
20989
|
paraPr(0),
|
|
20968
|
-
paraPr(1, { align: "LEFT", spaceBefore: 800, spaceAfter: 200, lineSpacing: 180 }),
|
|
20969
|
-
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: 170 }),
|
|
20970
|
-
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: 160 }),
|
|
20971
|
-
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: 160 }),
|
|
20990
|
+
paraPr(1, { align: "LEFT", spaceBefore: 800, spaceAfter: 200, lineSpacing: 180, outlineLevel: 0 }),
|
|
20991
|
+
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: 170, outlineLevel: 1 }),
|
|
20992
|
+
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: 160, outlineLevel: 2 }),
|
|
20993
|
+
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: 160, outlineLevel: 3 }),
|
|
20972
20994
|
paraPr(5, { align: "LEFT", lineSpacing: 130, indent: 400 }),
|
|
20973
20995
|
paraPr(6, { align: "LEFT", lineSpacing: 150, indent: 600 }),
|
|
20974
20996
|
paraPr(7, { align: "LEFT", lineSpacing: 160, indent: 600 })
|
|
@@ -20981,10 +21003,10 @@ ${base2.join("\n")}
|
|
|
20981
21003
|
const titleAlign = gongmun.centerTitle ? "CENTER" : "LEFT";
|
|
20982
21004
|
const base = [
|
|
20983
21005
|
paraPr(0, { lineSpacing: ls, keepWord: true }),
|
|
20984
|
-
paraPr(1, { align: titleAlign, spaceBefore: 400, spaceAfter: 400, lineSpacing: ls, keepWord: true }),
|
|
20985
|
-
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: ls, keepWord: true }),
|
|
20986
|
-
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: ls, keepWord: true }),
|
|
20987
|
-
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: ls, keepWord: true }),
|
|
21006
|
+
paraPr(1, { align: titleAlign, spaceBefore: 400, spaceAfter: 400, lineSpacing: ls, keepWord: true, outlineLevel: 0 }),
|
|
21007
|
+
paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: ls, keepWord: true, outlineLevel: 1 }),
|
|
21008
|
+
paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: ls, keepWord: true, outlineLevel: 2 }),
|
|
21009
|
+
paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: ls, keepWord: true, outlineLevel: 3 }),
|
|
20988
21010
|
paraPr(5, { align: "LEFT", lineSpacing: 130, indent: 400, keepWord: true }),
|
|
20989
21011
|
paraPr(6, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true }),
|
|
20990
21012
|
paraPr(7, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true })
|
|
@@ -20999,6 +21021,17 @@ ${base2.join("\n")}
|
|
|
20999
21021
|
${base.join("\n")}
|
|
21000
21022
|
</hh:paraProperties>`;
|
|
21001
21023
|
}
|
|
21024
|
+
function buildNumberings() {
|
|
21025
|
+
const heads = Array.from(
|
|
21026
|
+
{ length: 7 },
|
|
21027
|
+
(_, 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"/>`
|
|
21028
|
+
).join("\n");
|
|
21029
|
+
return `<hh:numberings itemCnt="1">
|
|
21030
|
+
<hh:numbering id="1" start="0">
|
|
21031
|
+
${heads}
|
|
21032
|
+
</hh:numbering>
|
|
21033
|
+
</hh:numberings>`;
|
|
21034
|
+
}
|
|
21002
21035
|
function generateHeaderXml(theme, gongmun, ratioVariants = []) {
|
|
21003
21036
|
const bodyFace = gongmun?.bodyFont === "gothic" ? "\uB9D1\uC740 \uACE0\uB515" : "\uD568\uCD08\uB86C\uBC14\uD0D5";
|
|
21004
21037
|
const charPropsXml = buildCharProperties(theme, gongmun, ratioVariants);
|
|
@@ -21076,7 +21109,7 @@ function generateHeaderXml(theme, gongmun, ratioVariants = []) {
|
|
|
21076
21109
|
</hh:borderFills>
|
|
21077
21110
|
${charPropsXml}
|
|
21078
21111
|
<hh:tabProperties itemCnt="0"/>
|
|
21079
|
-
|
|
21112
|
+
${buildNumberings()}
|
|
21080
21113
|
<hh:bullets itemCnt="0"/>
|
|
21081
21114
|
${paraPropsXml}
|
|
21082
21115
|
<hh:styles itemCnt="1">
|
|
@@ -21341,7 +21374,7 @@ function bestSimInRange(arr, from, to, target) {
|
|
|
21341
21374
|
return best;
|
|
21342
21375
|
}
|
|
21343
21376
|
function escapeGfm(text) {
|
|
21344
|
-
return text.replace(
|
|
21377
|
+
return text.replace(/([~*])/g, "\\$1");
|
|
21345
21378
|
}
|
|
21346
21379
|
var HWP_SHAPE_ALT_TEXT_RE = /(?:모서리가 둥근 |둥근 )?(?:사각형|직사각형|정사각형|원|타원|삼각형|이등변 삼각형|직각 삼각형|선|직선|곡선|화살표|굵은 화살표|이중 화살표|오각형|육각형|팔각형|별|[4-8]점별|십자|십자형|구름|구름형|마름모|도넛|평행사변형|사다리꼴|부채꼴|호|반원|물결|번개|하트|빗금|블록 화살표|수식|표|그림|개체|그리기\s?개체|묶음\s?개체|글상자|수식\s?개체|OLE\s?개체)\s?입니다\.?/g;
|
|
21347
21380
|
function sanitizeText(text) {
|
|
@@ -21359,7 +21392,7 @@ function normForMatch(text) {
|
|
|
21359
21392
|
return sanitizeText(text).replace(/\s+/g, " ").trim();
|
|
21360
21393
|
}
|
|
21361
21394
|
function unescapeGfm(text) {
|
|
21362
|
-
return text.replace(
|
|
21395
|
+
return text.replace(/\\([~*])/g, "$1");
|
|
21363
21396
|
}
|
|
21364
21397
|
function summarize(text) {
|
|
21365
21398
|
const t = text.replace(/\s+/g, " ").trim();
|
|
@@ -21426,7 +21459,7 @@ function parseGfmTable(lines) {
|
|
|
21426
21459
|
return rows;
|
|
21427
21460
|
}
|
|
21428
21461
|
function unescapeGfmCell(text) {
|
|
21429
|
-
return text.replace(/<br\s*\/?>/gi, "\n").replace(/\\\|/g, "|").replace(
|
|
21462
|
+
return text.replace(/<br\s*\/?>/gi, "\n").replace(/\\\|/g, "|").replace(/\\([~*])/g, "$1");
|
|
21430
21463
|
}
|
|
21431
21464
|
function replicateCellInnerHtml(cell) {
|
|
21432
21465
|
if (cell.blocks?.length) {
|
|
@@ -21685,7 +21718,7 @@ function generateSecPr(gongmun) {
|
|
|
21685
21718
|
header: 0,
|
|
21686
21719
|
footer: 0
|
|
21687
21720
|
} : { top: 8504, bottom: 4252, left: 5670, right: 4252, header: 2835, footer: 2835 };
|
|
21688
|
-
return `<hp:secPr textDirection="HORIZONTAL" spaceColumns="1134" tabStop="8000" outlineShapeIDRef="
|
|
21721
|
+
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>`;
|
|
21689
21722
|
}
|
|
21690
21723
|
function blocksToSectionXml(blocks, theme, gongmun, gongmunList = gongmun ? precomputeGongmunList(blocks, gongmun) : null, fit = null) {
|
|
21691
21724
|
const paraXmls = [];
|
|
@@ -21742,7 +21775,10 @@ function blocksToSectionXml(blocks, theme, gongmun, gongmunList = gongmun ? prec
|
|
|
21742
21775
|
}
|
|
21743
21776
|
const indent = block.indent || 0;
|
|
21744
21777
|
let marker;
|
|
21745
|
-
if (block.
|
|
21778
|
+
if (block.marker) {
|
|
21779
|
+
marker = `${block.marker} `;
|
|
21780
|
+
prevWasOrdered = !!block.ordered;
|
|
21781
|
+
} else if (block.ordered) {
|
|
21746
21782
|
orderedCounters[indent] = (orderedCounters[indent] || 0) + 1;
|
|
21747
21783
|
for (const k of Object.keys(orderedCounters)) {
|
|
21748
21784
|
if (+k > indent) delete orderedCounters[+k];
|
|
@@ -24550,7 +24586,7 @@ async function parseHwp(buffer, options) {
|
|
|
24550
24586
|
async function parsePdf(buffer, options) {
|
|
24551
24587
|
let parsePdfDocument;
|
|
24552
24588
|
try {
|
|
24553
|
-
const mod = await import("./parser-
|
|
24589
|
+
const mod = await import("./parser-2THIF623.js");
|
|
24554
24590
|
parsePdfDocument = mod.parsePdfDocument;
|
|
24555
24591
|
} catch {
|
|
24556
24592
|
return {
|