mugiwara85/CodeblockCustomizer

Nested code blocks have problems when copying by Copy button

Closed this issue · 8 comments

````
```dataviewjs
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>

Ahh. I will look at this today

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.

Nevermind, I can reproduce it.

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

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

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!

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.

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