@office-open/docx 0.10.8 → 0.10.9

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.
@@ -12330,22 +12330,22 @@ function parseTocFieldFromElements(els) {
12330
12330
  return opts;
12331
12331
  }
12332
12332
  /**
12333
- * Select the rendered-entry paragraphs of a captured TOC field the paragraphs
12334
- * between the field's `separate` and `end` markers. Tracks field depth so a
12335
- * nested HYPERLINK/PAGEREF field inside an entry doesn't fool the boundary
12336
- * detection.
12333
+ * Select the rendered-entry paragraphs of a captured TOC field. Tracks field
12334
+ * depth so a nested HYPERLINK/PAGEREF field inside an entry doesn't fool the
12335
+ * boundary detection.
12337
12336
  *
12338
- * Uses the post-walk `afterSeparate` flag (not a pre-walk snapshot) so an entry
12339
- * whose paragraph also carries the `separate` marker is still captured, and
12340
- * requires rendered text (`w:t`) so a paragraph holding only the `separate`
12341
- * marker isn't mistaken for an entry.
12337
+ * A paragraph is an entry when, after walking it, the field is past `separate`
12338
+ * and not past `end` (depth ≥ 1) and the paragraph carries rendered text (`w:t`).
12339
+ * This captures an entry whose paragraph also opens the field (`begin`) or holds
12340
+ * the `separate` marker common when Word emits begin + separate + first entry
12341
+ * in one paragraph — while the `w:t` requirement excludes a pure control
12342
+ * paragraph (field head / separate-only / end).
12342
12343
  */
12343
12344
  function selectTocEntryElements(els) {
12344
12345
  const entries = [];
12345
12346
  let depth = 0;
12346
12347
  let afterSeparate = false;
12347
12348
  for (const el of els) {
12348
- const depthBefore = depth;
12349
12349
  const walk = (node) => {
12350
12350
  if (node.name === "w:fldChar") {
12351
12351
  const type = attr(node, "w:fldCharType");
@@ -12356,7 +12356,7 @@ function selectTocEntryElements(els) {
12356
12356
  for (const c of node.elements ?? []) if (c.type === "element") walk(c);
12357
12357
  };
12358
12358
  walk(el);
12359
- if (depthBefore === 1 && afterSeparate && depth >= 1 && findDeep(el, "w:t").length > 0) entries.push(el);
12359
+ if (afterSeparate && depth >= 1 && findDeep(el, "w:t").length > 0) entries.push(el);
12360
12360
  }
12361
12361
  return entries;
12362
12362
  }
@@ -13605,4 +13605,4 @@ const webSettingsDesc = {
13605
13605
  //#endregion
13606
13606
  export { PageBorderZOrder as $, stringifyCustomXmlShell as $t, StyleLevel as A, createBodyProperties as An, sectionPageSizeDefaults as At, stringifyNumberingStyle as B, TextboxTightWrapType as Bn, NumberFormat as Bt, footnotesDesc as C, EmphasisMarkType as Cn, parseSdtBlock as Ct, selectTocEntryElements as D, TextVertOverflowType as Dn, sectionPropertiesDesc as Dt, parseTocFieldInstruction as E, TextHorzOverflowType as En, parseSectionPropertiesEl as Et, extractStyleId as F, HighlightColor as Fn, createVerticalPosition as Ft, createHeaderFooterReference as G, TextWrappingSide as Gt, stringifyTableStyle as H, LineRuleType as Hn, VerticalPositionAlign as Ht, parseStyleDefinitions as I, TextEffect as In, createHorizontalPosition as It, LineNumberRestartFormat as J, checkboxSymbolRunInner as Jt, SectionType as K, TextWrappingType as Kt, DefaultStylesFactory as L, PageNumber as Ln, HorizontalPositionRelativeFrom as Lt, Styles as M, createImageData$1 as Mn, PageOrientation as Mt, buildNumberingCache as N, Media as Nn, PageNumberSeparator as Nt, SdtDateMappingType as O, TextVerticalType as On, stringifySectionPropertiesXml as Ot, buildStyleCache as P, createTransformation as Pn, createPageNumberType as Pt, PageBorderOffsetFrom as Q, setBodyParseChild as Qt, stringifyCharacterStyle as R, breakXml as Rn, VerticalPositionRelativeFrom as Rt, endnotesDesc as S, PositionalTabRelativeTo as Sn, stringifyTableOfContents as St, parseTocFieldFromElements as T, TextBodyWrappingType as Tn, FontWrapper as Tt, HeaderFooterReferenceType as U, AlignmentType as Un, createWrapThrough as Ut, stringifyParagraphStyle as V, HeadingLevel as Vn, SpaceType as Vt, HeaderFooterType as W, createWrapTight as Wt, createPageMargin as X, parseCustomXmlProperties as Xt, createLineNumberType as Y, customXmlBlockDesc as Yt, PageBorderDisplay as Z, sdtBlockDesc as Zt, glossaryDesc as _, createFormFieldData as _n, parseParagraph as _t, appPropertiesDesc as a, WidthType as an, LevelFormat as at, CharacterSet as b, PositionalTabAlignment as bn, stringifyDocumentXml as bt, relationshipsDesc as c, TableLayoutType as cn, parseTablePropertiesEl as ct, withAltChunkOverrides as d, RelativeVerticalPosition as dn, tableDesc as dt, stringifySdtPr as en, DocumentGridType as et, withMediaDefaults as f, TableAnchorType as fn, stringifyChildDispatch as ft, DocPartType as g, FormFieldTextType as gn, resetDrawingIdGen as gt, DocPartGallery as h, ProofErrorType as hn, drawingDesc as ht, webSettingsDesc as i, objectDesc as in, parseNumberingDefinitions as it, settingsDesc as j, parseBodyProperties as jn, PageTextDirectionType as jt, SdtLock as k, VerticalAnchor as kn, sectionMarginDefaults as kt, buildContentTypesFromRegistry as l, OverlapType as ln, parseTableRowPropertiesEl as lt, DocPartBehavior as m, VerticalMergeType as mn, stringifyRunInline as mt, frameXml as n, subDocDesc as nn, DocumentAttributeNamespaces as nt, customPropertiesDesc as o, TABLE_BORDERS_NONE as on, LevelSuffix as ot, commentsDesc as p, TextDirection as pn, stringifyParagraphInline as pt, createSectionType as q, altChunkDesc as qt, framesetXml as r, stringifyElement as rn, Numbering as rt, corePropertiesDesc as s, BorderStyle as sn, parseTableCellPropertiesEl as st, TargetScreenSize as t, stringifySdtShell as tn, createDocumentGrid as tt, contentTypesDesc as u, RelativeHorizontalPosition as un, setTableParseChild as ut, bibliographyDesc as v, parseFormFieldData as vn, parseParagraphProperties as vt, parseToc as w, UnderlineType as wn, parseSdtProperties as wt, EditGroupType as x, PositionalTabLeader as xn, replaceRelsWithPlaceholders as xt, fontTableDesc as y, RubyAlign as yn, stringifyBodyChild as yt, stringifyConditionalTableStyle as z, TextAlignmentType as zn, HorizontalPositionAlign as zt };
13607
13607
 
13608
- //# sourceMappingURL=parts-CLMCjd4e.mjs.map
13608
+ //# sourceMappingURL=parts-CATV83XR.mjs.map