Correctly paste code as code block

First I thought it was bug

But Obsidian just doesn’t have this functionality Zettlr

Copying code block from this site

from sklearn.datasets import load_boston
boston = load_boston()
df = pd.DataFrame(boston.data, columns=boston['feature_names'])

results in

from sklearn.datasets import load\_boston
boston \= load\_boston()
df \= pd.DataFrame(boston.data, columns\=boston\['feature\_names'\])

instead of expected intended code block as implemented in Zettlr (result is a code block starting for tabs)

from sklearn.datasets import load_boston
boston = load_boston()
df = pd.DataFrame(boston.data, columns=boston['feature_names'])

So my request was to implement copying code blocks in a rich mode as code blocks

It’s interesting… I think there may be something website-related there that doesn’t recognize the code block as such, e.g. try copying code from this site for example (which at least for me it works). I’ll modify your title a little bit to provide more context.

1 Like

Indeed, this may be some obscure border case.

Copying modern sites with code work well as you pointed me.

The topic may be closed, I think.

1 Like