nothingislost / obsidian-codemirror-options

Obsidian plugin with options to customize the behavior of CodeMirror
GNU General Public License v3.0
174 stars 13 forks source link

bug: broken markdown options with Tab size less than 4 #4

Open OlegLustenko opened 3 years ago

OlegLustenko commented 3 years ago

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

nothingislost commented 3 years ago

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 commented 3 years ago

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