I’m writing articles that are published in different locations. I typically just write a markdown file locally using VsCode and then publish it at the sources.
However, it’s pretty cumbersome with Ghost Blog as it doesn’t recognize markdown tags when copy/pasting (for instance, code blocks ```).
Am I doing it wrong or isn’t there support for pasting markdown?
If you write your Markdown using Obsidian - a semi-WYSIWYG note-taking app - there is a Send to Ghost plugin that uploads it and the MD is automagically converted to native Ghost text. Code blocks are supported - I’ve just checked. Inevitably, because of the slightly different flavours of MD and the various things the Ghost editor supports, some things are not supported. Most significant for me are footnotes, but there are other solutions to that.
However, when you copy from VSCode it doesn’t only store markdown/plain-text in the clipboard, it also stores a HTML version of the editor contents. That HTML version is what our editor ends up trying to parse when pasting because the typical use-case for our editor is copy/pasting from websites and other web editors rather than code editors.
If you copy markdown from VSCode, then you can paste as plain-text instead of HTML - therefore making use of our Markdown parsing - by using the “Paste and match style” option (at least on macOS, it may be called something else on Windows) instead of a straight paste.
Alternatively, there’s a VSCode option called “Copy with syntax highlighting” that you can disable (it defaults to on) in which case normal copy/paste of markdown will work.