mugiwara85/CodeblockCustomizer

Keep blank lines in reading mode

Closed this issue · 18 comments

Hello,for clearer code hierarchy, you need to leave blank lines sometimes in the code block, but the plug-in will swallow these blank lines. thanks~

editing view:

image

rereading view:

image

Hi!
Oh, I made a small mistake as I see. I had this problem, but corrected it (apparently not fully). If you enable the line numbers, then it will be shown correctly. Fow now as a workaround. I will correct it, probably at the weekend.

hi,thank you very much for your reply,and I look forward to your fix.

By the way, I suggest whether you can set the color of light and dark modes at the same time. Otherwise, when I switch the two modes, it will be a little cumbersome to switch the theme.

As most themes provide:

image

thanks~

Hi! What do you mean by "whether you can set the color of light and dark modes at the same time"? I don't really understand what you mean by that? Can you please explain a bit better?

I know you provide the default dark and light theme.

but, I need to use light mode in the daytime and dark mode in the dark.

so, it may be a little troublesome to switch them frequently. Can it follow the obsidian mode for adaptation?

Oh yeah. That, I wanted to correct as well. I just haven't figured it out, how can I query which obsidian theme (dark or light) is selected currently. But I will look at this also at the weekend.

hey, do you know by any chance a plugin, which changes its theme, if obsidians theme is changed? I would look at it, how they did it, so I can implement it as well.

this plugin is also with “style setting plugin” by the css to set its color:

Hi! I released a new version (1.0.1), where the empty lines are now shown correctly in reading mode. I also changed a bit the theming. Now the themes will be set automatically according to Obsidians selected theme. I also added two toggles so you can save your theme as a default light or dark theme. I also updated a readme. Hope it is understandable. Please test, and give me a feedback.

oh, and until I don't forget, you might need to delete(just this once) the <YourVault>\.obsidian\plugins\codeblock-customizer\data.json file, since, I made some changes there as well.

hello,I have tested,there is a little problem with auto-switching themes:it dosen‘t work sometimes,and the console reports the following error

image

That's interesting. Did you delete the data.json file as I described above?

That's interesting. Did you delete the data.json file as I described above?

yeah,i deleted,but it automatically generates another one

Yes, but that's OK. Just so i can reproduce the issue, what do you exactly do when the error is displayed? Switch obsidians theme from dark to light or adapt? Or do you change something else? I was testing for at least an hour but it worked for me.

i installed it again,and found that the first switch worked fine,but then it stopped working。

And I found that the error prompted by console occurred when going from light to dark, but not the other way around

I tested it once in the default configuration. I find that switching themes only works the first time。
and every time i reload a Markdown file, it will occurs the following error:

image

I'm really sorry. I think I used it improperly. Now it works well. Although there are still some minor errors in the console. thanks~

image

Is it working? What do you mean by "you used it improperly?"