I want to hide Obsidian comments (%% … %%) in editing mode (except in active lines), but keep HTML comments (<!-- … -->) visible throughout the note. (This would give me two different ways to annotate text.)
Things I have tried
I have this simple CSS snippet to hide comments in editing mode, except in active lines:
this works only in Live Preview editing mode as requested
this does not use display: none because that collapses the whole line and you will never be able to edit it again in Live Preview mode (except in source mode)
instead uses visibility: hidden so that the comment line doesn’t collapse but you cannot see it unless you move the cursor to its line
this works even if you just use the starting %% or just the ending %%, or both