Repository navigation
feat: Table of Contents and Child Pages Component - #298
Closed
Shadowfita wants to merge 11 commits into
Closed
Shadowfita wants to merge 11 commits into
Shadowfita wants to merge 11 commits into
Conversation
MVP table of contents. Will add a component menu with style choices soon.
Added component menu Added support for toggling between "Table of Contents" or "Table of Child Pages"
|
Hi 👋 |
|
Hi @Shadowfita, could you check the Contributor License Agreement? This feature would be very useful |
Contributor
Author
Oh weird, I had completed it previously. I'll check it out in the morning. |
|
Is it possible to export the table of contents? |
|
Is this still to be added please? Could really do with this feature. |
Member
|
Closing as we now have table of contents integrated #981. |
Member
|
For child pages, see #1462. |
vvzvlad
pushed a commit
to vvzvlad/gitmost
that referenced
this pull request
Jul 3, 2026
…he server (docmost#298) Page/space export (Markdown & HTML, both via jsonToHtml -> generateHTML) crashed with "Export failed:undefined" on any page carrying a `comment` mark. Root cause: comment.renderHTML returned a LIVE DOM node (document.createElement + a click listener) whenever a global `document` existed — and the in-process MCP module injects a jsdom global.window+global.document into the Node server, defeating the old `typeof document === "undefined"` guard. The server export runs happy-dom's DOMSerializer, which crashes appending the foreign jsdom node (NodeUtility.isInclusiveAncestor -> "Cannot read properties of undefined (reading 'length')"). comment is the only extension returning a live node. Fix: widen the guard with an isNodeRuntime check (process.versions.node) so on any Node runtime renderHTML returns the plain, serializable spec array — even when MCP injected jsdom globals. The browser branch (createElement + click -> ACTIVE_COMMENT_EVENT) is untouched, so in-editor comment interactivity is preserved (Vite defines only process.env as a member-expression substitution, no `process` object in the browser bundle, so isNodeRuntime is false there). The mcp schema mirror already returns a spec array and is not on the export path (tiptapExtensions imports Comment from @docmost/editor-ext), so no mirror change is needed. Also: export-modal now reads the real error text from the response Blob (responseType:'blob' made err.response.data.message always undefined) so a failed export shows the server's message instead of "undefined". Adds a regression test that runs the real jsonToHtml on a comment-marked doc with jsdom globals injected (reproduces the crash on the unpatched code, passes after). closes docmost#298 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
vvzvlad
pushed a commit
to vvzvlad/gitmost
that referenced
this pull request
Jul 3, 2026
…e isNodeRuntime guard (F1) The whole fix's correctness rests on isNodeRuntime being false in the browser (so the interactive live-DOM comment branch still runs), and that is NOT covered by any test (client vitest runs under jsdom->node where isNodeRuntime is true). Document it: Vite substitutes only process.env, not the bare process object, so typeof process is undefined in the client bundle; do not add a process polyfill without revisiting this guard, or comment interactivity dies silently. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
vvzvlad
pushed a commit
to vvzvlad/gitmost
that referenced
this pull request
Jul 3, 2026
…dom node on the server, crashing export (docmost#298)' (docmost#299) from fix/298-export-comment into develop Reviewed-on: https://gitea.vvzvlad.xyz/vvzvlad/gitmost/pulls/299
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.
This pull request adds a feature complete table of contents/child pages component that resolves #204 and resolves #95 .
Please see #241 for previous discussions.