johansatge / obsidian-automatic-table-of-contents

💠 An Obsidian plugin to create a table of contents in a note, that updates itself when the note changes
MIT License
146 stars 13 forks source link

[BUG]: Link appearing when display=none #47

Closed ianTevesAcc closed 4 months ago

ianTevesAcc commented 4 months ago

Higher rank css rules over power the css rule of link causing the display none to be shown. We should probably add display: none !important; for the link so that its not over ruled by previous rules.

image

Solved with a bit of css.

.block-language-table-of-contents li a[style="display: none;"] {
    display: none !important;
}
title: 
style: nestedOrderedList # TOC style (nestedList|nestedOrderedList|inlineFirstLevel)
minLevel: 0 # Include headings from the specified level
maxLevel: 0 # Include headings up to the specified level
includeLinks: true # Make headings clickable
debugInConsole: false # Print debug info in Obsidian console

Checklist:

  • [x] Check in the readme if the bug is linked to a documented limitation
  • [x] Describe what the bug is
  • [x] Paste a Markdown block that helps reproducing the described issue
  • [x] Upload a screenshot with the rendered result if relevant
  • [-] Describe the environment (OS, Obsidian version, installed plugins)
ianTevesAcc commented 4 months ago

You can work around this bug by adding the following css snippet:

.workspace-leaf-content[data-mode="source"] .block-language-table-of-contents li a[style="display: none;"] {
    display: none !important;
}

This disables the link when not in source view. A plugin update should be created in the future though.