Obsidian-Code-Styler icon indicating copy to clipboard operation
Obsidian-Code-Styler copied to clipboard

Bug: Source and Preview Modes

Open nenv opened this issue 2 years ago • 9 comments

When using the Read mode with the default theme, the icons do not work, and neither does the title or code highlighting. To make it work, you should go to the Editor settings and enable the 'Preview' option instead of the 'Source' mode.

I usually use Obsidian in 'Source' mode to view the Markdown syntax. Because of this, the feature doesn't work for me. The main issue is that it is using the preview mode to load both the icon, title, and code highlighting.

With the default theme, I managed to make the icon and title work, but only partially. I'm not sure why not all codes are working, but I have attached images for reference.

image

At the top, you can see that some icons appear to have executed, but at the bottom, it's clear that they didn't. Both have the same syntax, so in both cases, the icons should be visible. I'm in the preview mode, in the read mode.

image

The following image shows how in preview mode, not in read mode, it's possible to see the icon and the title within code blocks correctly. This implies that there is an issue in read mode since it's not representing them correctly. It's also noticeable that in read mode, I can't see the line code highlighting, which is visible in the preview mode.

image

Here, I'm showcasing the preview mode configuration. My interface is in Spanish, but I believe it's understandable with the marks I've made. I'm referring to the option we need to activate. I'll attach an image that demonstrates how the plugin looks when that option isn't enabled.

image

image

image

All these tests were done in a completely new vault. However, there's an additional issue that I noticed in my main vault. When using the Solarized theme, icons, code highlighting, and titles are not visible in the read view, no matter what you do. In this case, it's mandatory to use the preview mode instead of the source mode when using the Solarized theme.

image

image

image

image

image

image

nenv avatar Nov 27 '23 15:11 nenv

Hi, thanks for the report. I'll have a look into it and see what I find!

mayurankv avatar Nov 27 '23 23:11 mayurankv

This issue is stale because it has been open 60 days with no activity.

github-actions[bot] avatar Jan 27 '24 01:01 github-actions[bot]

Sorry I haven't had a chance to look at this yet but it hasn't been forgotten. Currently doing a quick run through of all the issues so I can see what needs doing.

mayurankv avatar Feb 12 '24 22:02 mayurankv

Ok, so this is weird, I did some cursory testing and it seems that if I'm using the editor in source mode, my reading mode works fine with both themes. Could you provide me with some code which breaks this? (i.e. in a code block or a file)

I'm not sure whether there could be some plugin conflict or something but you said you could reproduce in a new vault. The other thing could be language issues? But I have no idea how that would affect it. I'm going to wait till I have more information to do any more testing because I'm not 100% sure what is going wrong here. Look forward to your response and sorry for the delay!

mayurankv avatar Feb 12 '24 23:02 mayurankv

This issue is stale because it has been open 60 days with no activity.

github-actions[bot] avatar Dec 09 '24 02:12 github-actions[bot]

Is this still an issue for you?

mayurankv avatar Jan 27 '25 12:01 mayurankv