mugiwara85 / CodeblockCustomizer

Codeblock Customizer plugin for Obsidian
MIT License
168 stars 7 forks source link

bug: render error when using `shimmering focus` theme #13

Closed 17307 closed 1 year ago

17307 commented 1 year ago

When using the shimmering focus theme, if an undefined syntax type is used, the code block renders normally in edit mode, and additional css content is displayed on the code block in preview mode.

edit view (renders normally)

image

preiviw view (renders error)

image
mugiwara85 commented 1 year ago

Yes, I see that. I will look into it (probably this week. worst case next week), and give you a reply.

mugiwara85 commented 1 year ago

I looked at shimmering focus theme. I fixed a few errors in release 1.1.9, but there is one thing which I can't, or I am not sure I should. The grey line you see in reading view which displays the classes is a bug (I think) in the shimmering focus theme. The reason I think it is bug, because if you have an undefined syntax type the name will be displayed correctly in editing view (even if my plugin is enabled). The problem only occurs in reading view. Basically, the theme would display the class associated with that code block, but since I add more classes to it, so I can style it, and that's why it displays this list. I fixed, that the code block is now right below the header, and the icon was displayed also incorrectly with this theme. I fixed that as well. For this problem, I can however recommend 2 possible solutions:

  1. Contact the theme developer, and hopefully he will be able to fix it.
  2. You could add the following CSS to your snippets folder:
    
    .codeblock-customizer-pre::before {
    content: "" !important;
    }

.codeblock-customizer-pre::after { content: "" !important; }

This would remove that line completely.
If the developer fixes this mistake, you could set the color for that line by using the following snippet:
```css
.codeblock-customizer-pre::before {
  background-color: transparent !important;
}

This way it would be set for the same color as the code block background color.

17307 commented 1 year ago

I fixed this bug by the second way, thank you very much for your help, and it's a wonderful plugin, thank you again.