feat(markdown): add HTML-based table of contents

This commit is contained in:
Elian Doran
2026-04-24 17:37:16 +03:00
parent f0a8002a15
commit d4fa608dfe
2 changed files with 2 additions and 1 deletions
@@ -75,7 +75,7 @@ function useItems(rightPaneVisible: boolean, widgetsByParent: WidgetsByParent) {
const definitions: RightPanelWidgetDefinition[] = [
{
el: <TableOfContents />,
enabled: (noteType === "text" || noteType === "doc" || isPdf),
enabled: (noteType === "text" || noteType === "doc" || isPdf || !!note?.isMarkdown()),
},
{
el: <PdfPages />,
@@ -39,6 +39,7 @@ export default function TableOfContents() {
{((noteType === "text" && isReadOnly) || (noteType === "doc")) && <ReadOnlyTextTableOfContents />}
{noteType === "text" && !isReadOnly && <EditableTextTableOfContents />}
{noteType === "file" && noteMime === "application/pdf" && <PdfTableOfContents />}
{note?.isMarkdown() && <ReadOnlyTextTableOfContents />}
</RightPanelWidget>
);
}