mugiwara85 / CodeblockCustomizer

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

Nested code blocks have problems when copying by Copy button #51

Closed calmwaves111 closed 9 months ago

calmwaves111 commented 10 months ago
const files=dv.pages

The copied content will become

<div><div class="codeblock-customizer-line-number"><span class="codeblock-customizer-line-number-element">1</span></div><div class="codeblock-customizer-line-text">```dataviewjs</div></div><div><div class="codeblock-customizer-line-number"><span class="codeblock-customizer-line-number-element">2</span></div><div class="codeblock-customizer-line-text">const files=dv.pages</div></div><div><div class="codeblock-customizer-line-number"><span class="codeblock-customizer-line-number-element">3</span></div><div class="codeblock-customizer-line-text">```</div></div>
mugiwara85 commented 10 months ago

Ahh. I will look at this today

mugiwara85 commented 10 months ago

Sorry, I can't reproduce this. Did this happen in edit mode or reading mode? If you can reproduce it multiple times, please describe how did you do it.

mugiwara85 commented 10 months ago

Nevermind, I can reproduce it.

mugiwara85 commented 9 months ago

Can you please check if the problem still persists in version 1.2.2?

calmwaves111 commented 9 months ago

hello, I found that this is not a problem with nested code, but rather a problem with not specifying the code language Even if I only wrote three points but did not specify a code language, this situation would occur image while I specify a code language, it work well image

mugiwara85 commented 9 months ago

oh I see. This explains why I was able to reproduce it once, and why I wasn't it other time. I will look into this again. Thanks for the info!

mugiwara85 commented 9 months ago

As it turned out, this was the case not only for nested code blocks, but for every code block, without a language specified. I fixed it in version 1.2.3. Please test it out, and if there is a problem report back. I am closing the issue. If there is some problem, I'll reopen it.

calmwaves111 commented 9 months ago

Now it's working properly,thanks to your hard work.