I have a lot of notes in markdown that I would like to import to Onenote. Onenote does a bit of conversion but breaks when code blocks are added. Is there a setting where I can tweak how Onenote interprets markdown ?

  • How are you importing the markdown into onenote? Copy and paste? Or actual importing? In what way are code blocks breaking? – Raystafarian May 13 '14 at 18:38
  • Copy- paste, It shows code blocks as regular text and everything below it is indented one tab space to the right. with multiple code blocks it gets crazy pretty quickly – Shekhar May 17 '14 at 1:59
  • I did an export to Onenote but that exports it as image and its not editable – Shekhar May 17 '14 at 2:00


You have to turn on Markdown in the ribbon.xml config (see bottom of link), open a text editor in admin mode to edit the file, and turn the tag to 'true'.

| improve this answer | |
  • Thank you. Reading the docs always helps, but I wouldn't have stumbled upon this feature (I already had it installed) without your answer. – dgo Oct 16 '19 at 13:51

Do you have the ability to export the MD as HTML? If not, you can use something like Dillinger to do so.

If your code blocks are converted to <pre> or <code> blocks in HTML, you would be able to open the HTML page and copy it into OneNote while keeping the formatting. <pre> and <code> is dropped, however. You can use some simple CSS to style the content of the tags, which I believe will be copied as well.

| improve this answer | |

You might be able to automate something with PanDoc. It can accept MarkDown (among other things) and convert it to many other formats, including some that OneNote might understand, like HTML. It's mostly command-line, so a quick batch file might be in order.

pandoc "%~1" -o "temp.html"
del "temp.html"

With PanDoc and a batch file like that, you can drag and drop a MarkDown file onto the batch file, and a temp.html file will be generated in the source folder. Open it up, copy/paste the results into OneNote.

There are a list of OneNote Command-Line Switches, but they're for OneNote 2007, and I couldn't find a similar document for 2010. /paste and /insertdoc either pasted in raw HTML or nothing at all. Opening the temporary HTML file and copying the rendered results into OneNote works for me, but it's a bit of a hassle.

Another thing about pasting into OneNote is that it has never seemed to respect new lines. I always have to go back through large pasted documents and add the newlines back so that it's not all one giant paragraph. I have yet to find a solution for this.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.