kordoc 3.5.2 → 3.5.3

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/dist/index.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  sanitizeHref,
20
20
  stripDtd,
21
21
  toArrayBuffer
22
- } from "./chunk-QXXQIZBH.js";
22
+ } from "./chunk-JOLDAN3Q.js";
23
23
  import {
24
24
  parsePageRange
25
25
  } from "./chunk-GE43BE46.js";
@@ -20369,24 +20369,26 @@ function generateManifest() {
20369
20369
  </opf:spine>
20370
20370
  </opf:package>`;
20371
20371
  }
20372
- function charPr(id, height, bold, italic, fontId = 0, textColor = DEFAULT_TEXT_COLOR) {
20372
+ function charPr(id, height, bold, italic, fontId = 0, textColor = DEFAULT_TEXT_COLOR, ratioPct = 100) {
20373
20373
  const boldAttr = bold ? ` bold="1"` : "";
20374
20374
  const italicAttr = italic ? ` italic="1"` : "";
20375
20375
  const effFont = bold ? 2 : fontId;
20376
20376
  return ` <hh:charPr id="${id}" height="${height}" textColor="${textColor}" shadeColor="none" useFontSpace="0" useKerning="0" symMark="NONE" borderFillIDRef="0"${boldAttr}${italicAttr}>
20377
20377
  <hh:fontRef hangul="${effFont}" latin="${effFont}" hanja="${effFont}" japanese="${effFont}" other="${effFont}" symbol="${effFont}" user="${effFont}"/>
20378
- <hh:ratio hangul="100" latin="100" hanja="100" japanese="100" other="100" symbol="100" user="100"/>
20378
+ <hh:ratio hangul="${ratioPct}" latin="${ratioPct}" hanja="${ratioPct}" japanese="100" other="100" symbol="100" user="100"/>
20379
20379
  <hh:spacing hangul="0" latin="0" hanja="0" japanese="0" other="0" symbol="0" user="0"/>
20380
20380
  <hh:relSz hangul="100" latin="100" hanja="100" japanese="100" other="100" symbol="100" user="100"/>
20381
20381
  <hh:offset hangul="0" latin="0" hanja="0" japanese="0" other="0" symbol="0" user="0"/>
20382
20382
  </hh:charPr>`;
20383
20383
  }
20384
20384
  function paraPr(id, opts = {}) {
20385
- const { align = "JUSTIFY", spaceBefore = 0, spaceAfter = 0, lineSpacing = 160, indent = 0, left = 0 } = opts;
20386
- return ` <hh:paraPr id="${id}" tabPrIDRef="0" condense="0" fontLineHeight="0" snapToGrid="1" suppressLineNumbers="0" checked="0" textDir="AUTO">
20385
+ const { align = "JUSTIFY", spaceBefore = 0, spaceAfter = 0, lineSpacing = 160, indent = 0, left = 0, keepWord = false } = opts;
20386
+ const breakNonLatin = keepWord ? "KEEP_WORD" : "BREAK_WORD";
20387
+ const snapGrid = keepWord ? "0" : "1";
20388
+ return ` <hh:paraPr id="${id}" tabPrIDRef="0" condense="0" fontLineHeight="0" snapToGrid="${snapGrid}" suppressLineNumbers="0" checked="0" textDir="AUTO">
20387
20389
  <hh:align horizontal="${align}" vertical="BASELINE"/>
20388
20390
  <hh:heading type="NONE" idRef="0" level="0"/>
20389
- <hh:breakSetting breakLatinWord="KEEP_WORD" breakNonLatinWord="BREAK_WORD" widowOrphan="0" keepWithNext="0" keepLines="0" pageBreakBefore="0" lineWrap="BREAK"/>
20391
+ <hh:breakSetting breakLatinWord="KEEP_WORD" breakNonLatinWord="${breakNonLatin}" widowOrphan="0" keepWithNext="0" keepLines="0" pageBreakBefore="0" lineWrap="BREAK"/>
20390
20392
  <hh:autoSpacing eAsianEng="0" eAsianNum="0"/>
20391
20393
  <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>
20392
20394
  <hh:lineSpacing type="PERCENT" value="${lineSpacing}"/>
@@ -20406,11 +20408,12 @@ function buildCharProperties(theme, gongmun) {
20406
20408
  h3 = body;
20407
20409
  h4 = Math.max(body - 100, 1300);
20408
20410
  }
20411
+ const bodyRatio = gongmun ? 95 : 100;
20409
20412
  const rows = [
20410
- charPr(0, body, false, false, 0, theme.body),
20411
- charPr(1, body, true, false, 0, theme.body),
20412
- charPr(2, body, false, true, 0, theme.body),
20413
- charPr(3, body, true, true, 0, theme.body),
20413
+ charPr(0, body, false, false, 0, theme.body, bodyRatio),
20414
+ charPr(1, body, true, false, 0, theme.body, bodyRatio),
20415
+ charPr(2, body, false, true, 0, theme.body, bodyRatio),
20416
+ charPr(3, body, true, true, 0, theme.body, bodyRatio),
20414
20417
  charPr(4, code, false, false, 1),
20415
20418
  charPr(5, h1, true, false, 1, theme.h1),
20416
20419
  charPr(6, h2, true, false, 1, theme.h2),
@@ -20442,21 +20445,21 @@ ${base2.join("\n")}
20442
20445
  const ls = gongmun.lineSpacing;
20443
20446
  const titleAlign = gongmun.centerTitle ? "CENTER" : "LEFT";
20444
20447
  const base = [
20445
- paraPr(0, { lineSpacing: ls }),
20446
- paraPr(1, { align: titleAlign, spaceBefore: 400, spaceAfter: 400, lineSpacing: ls }),
20447
- paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: ls }),
20448
- paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: ls }),
20449
- paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: ls }),
20450
- paraPr(5, { align: "LEFT", lineSpacing: 130, indent: 400 }),
20451
- paraPr(6, { align: "LEFT", lineSpacing: ls, indent: 600 }),
20452
- paraPr(7, { align: "LEFT", lineSpacing: ls, indent: 600 })
20448
+ paraPr(0, { lineSpacing: ls, keepWord: true }),
20449
+ paraPr(1, { align: titleAlign, spaceBefore: 400, spaceAfter: 400, lineSpacing: ls, keepWord: true }),
20450
+ paraPr(2, { align: "LEFT", spaceBefore: 600, spaceAfter: 150, lineSpacing: ls, keepWord: true }),
20451
+ paraPr(3, { align: "LEFT", spaceBefore: 400, spaceAfter: 100, lineSpacing: ls, keepWord: true }),
20452
+ paraPr(4, { align: "LEFT", spaceBefore: 300, spaceAfter: 100, lineSpacing: ls, keepWord: true }),
20453
+ paraPr(5, { align: "LEFT", lineSpacing: 130, indent: 400, keepWord: true }),
20454
+ paraPr(6, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true }),
20455
+ paraPr(7, { align: "LEFT", lineSpacing: ls, indent: 600, keepWord: true })
20453
20456
  ];
20454
20457
  for (let d = 0; d < GONGMUN_LIST_LEVELS; d++) {
20455
20458
  const { left, indent } = levelIndent(d, gongmun.bodyHeight, gongmun.numbering);
20456
20459
  const sectionGap = gongmun.numbering === "report" && d === 0 ? Math.round(gongmun.bodyHeight * 0.5) : 0;
20457
- base.push(paraPr(GONGMUN_LIST_BASE + d, { align: "JUSTIFY", lineSpacing: ls, left, indent, spaceBefore: sectionGap }));
20460
+ base.push(paraPr(GONGMUN_LIST_BASE + d, { align: "JUSTIFY", lineSpacing: ls, left, indent, spaceBefore: sectionGap, keepWord: true }));
20458
20461
  }
20459
- base.push(paraPr(GONGMUN_CENTER, { align: "CENTER", lineSpacing: ls }));
20462
+ base.push(paraPr(GONGMUN_CENTER, { align: "CENTER", lineSpacing: ls, keepWord: true }));
20460
20463
  return `<hh:paraProperties itemCnt="${base.length}">
20461
20464
  ${base.join("\n")}
20462
20465
  </hh:paraProperties>`;
@@ -20549,7 +20552,7 @@ function generateHeaderXml(theme, gongmun) {
20549
20552
  <hh:style id="0" type="PARA" name="\uBC14\uD0D5\uAE00" engName="Normal" paraPrIDRef="0" charPrIDRef="0" nextStyleIDRef="0" langIDRef="1042" lockForm="0"/>
20550
20553
  </hh:styles>
20551
20554
  </hh:refList>
20552
- <hh:compatibleDocument targetProgram="HWP2018"/>
20555
+ <hh:compatibleDocument targetProgram="HWP2018"><hh:layoutCompatibility/></hh:compatibleDocument>
20553
20556
  </hh:head>`;
20554
20557
  }
20555
20558
  function generateSecPr(gongmun) {
@@ -23515,7 +23518,7 @@ async function parseHwp(buffer, options) {
23515
23518
  async function parsePdf(buffer, options) {
23516
23519
  let parsePdfDocument;
23517
23520
  try {
23518
- const mod = await import("./parser-4FFTFIYL.js");
23521
+ const mod = await import("./parser-CPFIB47T.js");
23519
23522
  parsePdfDocument = mod.parsePdfDocument;
23520
23523
  } catch {
23521
23524
  return {