-
Notifications
You must be signed in to change notification settings - Fork 132
SD-2508 - fix: toc not being displayed inside w:sdt #2850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9422167
9dd9eab
ad510e0
56377a1
bad7fff
b5012f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,35 @@ export function handleDocumentPartObjectNode(node: PMNode, context: NodeHandlerC | |
| recordBlockKind?.(block.kind); | ||
| } | ||
| if (sectionState) sectionState.currentParagraphIndex++; | ||
| } else if (child.type === 'tableOfContents' && Array.isArray(child.content)) { | ||
| // A nested tableOfContents node (e.g. from a "Custom Table of Contents" SDT where | ||
| // the TOC field codes were preprocessed into an sd:tableOfContents element). | ||
| // Word stores the TOC field codes on the child node, not the wrapper SDT - prefer | ||
| // the child's instruction so per-TOC options aren't lost (mirrors the recursion | ||
| // inside processTocChildren in toc.ts). | ||
| const childTocInstruction = getNodeInstruction(child) ?? tocInstruction; | ||
| processTocChildren( | ||
| child.content, | ||
| { | ||
| docPartGallery: docPartGallery ?? '', | ||
| docPartObjectId, | ||
| tocInstruction: childTocInstruction, | ||
| sdtMetadata: docPartSdtMetadata, | ||
| }, | ||
| { | ||
| nextBlockId, | ||
| positions, | ||
| bookmarks, | ||
| hyperlinkConfig, | ||
| enableComments, | ||
| trackedChangesConfig, | ||
| themeColors, | ||
| converters, | ||
| converterContext, | ||
| sectionState, | ||
| }, | ||
| { blocks, recordBlockKind }, | ||
| ); | ||
|
Comment on lines
+103
to
+124
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your first commit also added a
child.type === 'table'branch with a test, and the "refactor" commit removed it. the linear ticket title is "drops tables" - was that handled somewhere else, or did it slip out of scope?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@caio-pizzol I had misunderstood the ticket back then. My understanding is that the ticket description might point to the wrong direction because the issue is related to TOC, not Tables. The document linked in the ticket has a TOC that is not being rendered, not a table.