Obsidian adds empty lines to my code when I paste it

Things I have tried

I searched the help and did not find an answer to this.

I am just starting with Obsidian. What I want to do is to create a note for each function in my Julia code. I created a note and added tags Function and ModelFunctions (the name of the package). Then I created a Callout and pasted the function code in it. The code was pasted but there is an empty line between every line of my code. I also tried to paste the code directly into the note and the same thing happened. How can I have my code show up in a note or a Callout exactly as it is in VSCode?

Another (much better) alternative would be to insert markers just before and after the function in the .jl (Julia) file and link to the file but just get the section between the markers. Is that possible?

Thanks from an absolute beginner.

Paste with Ctrl+Shift+V (or Option + Cmd + Shift + V on Mac). It will paste in plain-text, rather than with formatting.

This is not an Obsidian thing. Pasting as plain-text is a great shortcut to know for all apps - example Excel or Google Sheets.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.