Skip to content
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

[rexical-react] Bug Fix: Headings inside collapsible sections are lost when Table of Contents is re-initialized #6371

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

KatsiarynaDzibrova
Copy link
Contributor

Description

This pr changes the logic in TableOfContentsPlugin initialization. Previously only the headings on the highest level were added to the Table of Contents. Now the tree traversal is executed, so that the headings on all level are processed correctly, including headings inside Collapsible Sections and Tables.

Test plan

Before

The headings inside Collapsible sections disappear when ToC switched is toggled on and off.

toc-init-before

After

The Table of Contents stays the same when ToC switched is toggled on and off.

toc-init-after

Copy link

vercel bot commented Jul 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 4, 2024 10:45am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 4, 2024 10:45am

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 4, 2024
Copy link

github-actions bot commented Jul 4, 2024

size-limit report 📦

Path Size
lexical - cjs 28.47 KB (0%)
lexical - esm 28.28 KB (0%)
@lexical/rich-text - cjs 36.86 KB (0%)
@lexical/rich-text - esm 28.08 KB (0%)
@lexical/plain-text - cjs 35.49 KB (0%)
@lexical/plain-text - esm 25.3 KB (0%)
@lexical/react - cjs 38.82 KB (0%)
@lexical/react - esm 29.27 KB (0%)

@ivailop7 ivailop7 added this pull request to the merge queue Jul 4, 2024
Merged via the queue into facebook:main with commit f464655 Jul 4, 2024
39 of 42 checks passed
2wheeh pushed a commit to 2wheeh/lexical that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants