Skip to content

Commit

Permalink
Fix empty slate text block in table of contents (#5156)
Browse files Browse the repository at this point in the history
Co-authored-by: Tiberiu Ichim <tiberiuichim@users.noreply.github.com>
  • Loading branch information
kreafox and tiberiuichim authored Sep 26, 2023
1 parent 330f945 commit 6582921
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/5156.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix empty slate text block in table of contents. @kreafox
1 change: 1 addition & 0 deletions src/components/manage/Blocks/ToC/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const View = (props) => {
const level = entry[0];
const title = entry[1];
const items = [];
if (!title?.trim() && !block.plaintext?.trim()) return;
if (!level || !levels.includes(level)) return;
tocEntriesLayout.push(id);
tocEntries[id] = {
Expand Down

0 comments on commit 6582921

Please sign in to comment.