fix(converter): emit **TOC** marker for toc macro in storage → markdown - #266
Merged
Merged
Conversation
The walker returned an empty string for the toc macro, so the table of contents position was lost on read. Emit the **TOC** marker that markdown → storage already maps back to a toc macro, making the round-trip symmetric. floatmenu is unchanged. Fixes #265
|
🎉 This PR is included in version 2.25.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
confluence read -f markdowndrops the table of contents entirely.handleMacro()inlib/storage-walker.jsreturned an empty string for the self-closingtocmacro, so the TOC position was lost on read. The write direction already maps**TOC**to atocmacro, which made the round-trip asymmetric.Changes
tocnow renders as a standalone**TOC**block (same shape as the existing**ANCHOR: id**output), so markdown → storage → markdown preserves its position.floatmenuis unchanged and still renders nothing.11-layouts-and-edge-cases.expected.mdwithWRITE_PARITY_EXPECTED=1; the only diff is the added**TOC**paragraph.tests/macro-converter.test.js.Known limitations
maxLevel,minLevel,style, ...) cannot be expressed by**TOC**and are still dropped.anchor, atocmacro nested inside a table cell or list item is emitted inline and is not converted back to a macro on write.Testing
npm test(39 suites, 1485 tests) andeslintpass.Fixes #265