Formatting errors when pasting from VSCode

Hi, when I paste code from VSCode to obsidian, all the formatting is turned to mush. Can anyone advise what settings I should change to fix this?

The problems I get are:

  1. TABS get destroyed
  2. NEW LINEs get double formatted
  3. see screenshot to illustrate

I’ve tried the following:

  • set both Obsidian and VSCode to take tabs as 4 spaces (use tabs = off)
  • paste from VSCode-> Apple Notes → Obsidian, still same issue
  • note: formatting is fine when pasting from Obsidian to VSCode

It will really help to ahve a working copy-paste from VSCode to Obsidian. Can anyone advise what settings I should change to fix this?

What I’m trying to do

Found a solution.

Just paste as plain text: shift+cmd+z

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