mugiwara85 / CodeblockCustomizer

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

[Bug] When inputting content in Chinese at the head of a code block, it can cause some problems #47

Closed doit132 closed 4 months ago

doit132 commented 10 months ago

Problem Description

image

When I input content in the header of the code block using Chinese input method, there will be a space like thing in front of Chinese

image

Animation demonstration

动画

This problem not only occurs when inputting Chinese, but also when using the Chinese input method, regardless of whether the final screen is in English or Chinese

testing environment

mugiwara85 commented 10 months ago

That's interesting. I think it might have to do something with the input method, because if you take a chines string, then it wil be displayed correctly: image

Can you remove that first character? I can look into this problem as well.

mugiwara85 commented 10 months ago

Also, can you please try it out if the same happens if you disable the plugin?

doit132 commented 10 months ago

Also, can you please try it out if the same happens if you disable the plugin?

另外,如果禁用该插件也会出现同样的情况,请您尝试一下吗?

No, when i disable the plugin, this question don't happen, all is normal

I have also used multiple Chinese input method software for testing, and this issue occurs all the time

doit132 commented 10 months ago

That's interesting. I think it might have to do something with the input method, because if you take a chines string, then it wil be displayed correctly: image

这很有趣。我认为它可能必须对输入法做一些事情,因为如果你拿一个中文字符串,那么它就会正确显示:

Can you remove that first character? I can look into this problem as well.↳

There is no problem with the display of Chinese characters, but this space may be added during input, and may cause the entire page rendering to fail

like this

image

mugiwara85 commented 10 months ago

hm. interesting, as I don't do anything that could cause this. it should be just simply text. but I believe you. I will look into it what can cause this. I might get back to you if I have any questions.

doit132 commented 10 months ago

Another code block enhancement plugin also has the same issue, may it be an upstream issue

That plugin is code-styler

doit132 commented 9 months ago

Recently, the input method I used has been updated and this issue no longer occurs.

Although there will be no whitespace, it may still cause the entire document rendering to crash

mugiwara85 commented 9 months ago

If the update of the input method fixed this, then this means for me, that the input method you use causes these issues. There are some cases when the lines loose the associated classes. For example if you have a codeblock with no text, and collapse and uncollapse it, then somtimes it can be observed that not all the lines after uncollapse gets the classes associated with them which they should have. I think however, that this is either an Obsidian or a CodeMirror bug. I leaves this issue open for now, but it could take some time to figure this out.