obsidian-codemirror-options icon indicating copy to clipboard operation
obsidian-codemirror-options copied to clipboard

bug: broken markdown options with Tab size less than 4

Open OlegLustenko opened this issue 3 years ago • 2 comments

Hi, I really like the last feature "Hide markdown Tokens". It creates for me almost an outliner experience! Thanks for bringing it to the Obsidian community.

I've been playing a little with my Obsidian settings and have noticed that "Hide markdown Token" doesn't display TODOs such as [ ], [x] properly with Tab size(Options -> Editor) less then 4 setting

So steps to reproduce: Preconditions

  1. Obisidian codemirror-options is installed
  2. Hide markdown Tokens is enabled

Steps

  1. Create TODO inside Obisidian
  2. Set Tab size less than 4

actual Broken layout of tasks expected Layout stays the same as we have with Tab size 4

Tab Size 2 Image 2021-09-10 at 11 28 57 AM

Tab Size 4 Image 2021-09-10 at 11 29 33 AM

Real World use-case :) Image 2021-09-10 at 11 31 13 AM

Have you tried to restart Obisdian after changing Tab size? Yes Have you tried to remove your theme and disable custom css? Yes

OlegLustenko avatar Sep 10 '21 08:09 OlegLustenko

Yeah, unfortunately a lot of things break when changing the tab size from 4 to anything else. It breaks HyperMD's markdown parsing logic. Last I looked, it wasn't an easy fix but I'll take another look.

nothingislost avatar Sep 10 '21 20:09 nothingislost

One workaround for now is to use spaces rather than tabs.

image

That seems to fix the problem:

image

Also note that the Outliner plugin has this same limitation image

nothingislost avatar Sep 11 '21 02:09 nothingislost