From 9f3266abaf4b942d3b4f2adea6db71f33ef6dbaa Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 15 Aug 2022 22:46:49 +0200 Subject: [PATCH] Remove headings 4 and below from TOC, see: https://github.com/outline/outline/discussions/3973 --- app/scenes/Document/components/Contents.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/scenes/Document/components/Contents.tsx b/app/scenes/Document/components/Contents.tsx index 636b75118..cbfff513e 100644 --- a/app/scenes/Document/components/Contents.tsx +++ b/app/scenes/Document/components/Contents.tsx @@ -57,15 +57,17 @@ export default function Contents({ headings, isFullWidth }: Props) { {t("Contents")} {headings.length ? ( - {headings.map((heading) => ( - - {heading.title} - - ))} + {headings + .filter((heading) => heading.level >= 4) + .map((heading) => ( + + {heading.title} + + ))} ) : (