Importing Apple Notes creates files with HTML tags

Key Question

How do I import Apple Notes into Obsidian so that the resulting files don’t have the HTML tags?

What I’m trying to do

I’ve imported my Apple Notes via the Obsidian official Importer plug-in. However, the outputted notes are full of HTML tags. If I open one of these imported notes, it looks normal at first glance, but when I click on any of the lines of text, it shows the HTML tags that it was imported with.

For example:

An example of a line of imported text from Apple Notes

Essentially, what’s happening is that the .md file contains the HTML, so the .md files imported by the Obsidian Importer from Apple Notes creates files with content like:

- <span style="font-family:DMSans-Regular;">Mixed greens</span> 
- <span style="font-family:DMSans-Regular;">~10 cherry tomatoes</span>

This is problematic because the HTML tags make it become really annoying to edit the file. Every time I want to edit a line, I need to navigate through a bunch of HTML tags before I can get to the word/sentence that I want to edit. Also, when I try to search through my documents, all the HTML tags show up, which clutter the search results.

What I’ve tried

  • Searching for plug-ins that may accomplish this. Haven’t found any that handle this case.
  • The Obsidian Importer has an “Import HTML” mode, but I can’t use it because Apple Notes doesn’t store the notes files in accessible HTML files

You could use Replace… to get rid of them:

  1. Select <span style="font-family:DMSans-Regular;">.
  2. In the “…” menu, choose “Replace…”.
    • The “Find” field should be filled with the selection.
    • Leave the “Replace” field blank.
  3. Press “Replace all”.
  4. Open the next note.
  5. Repeat steps 3–4 until done.
  6. Repeat the whole process with </span> as the selection, if these Apple Notes spans are the only ones in your vault. If you have others you want to keep, then just delete the unwanted ones manually as you encounter them.

Because Replace… stays open when you switch notes, you can process a large number of files pretty quickly.

But if that still feels too slow, you can – after making a backup — use a separate text editor like VD Code or BBEdit that can do search-replace across files. Editors that can do that often support regular expressions, which would allow you to remove both the opening and closing tags in a single operation.

Or you could try these workarounds. I don’t know if either will work, and neither is smooth.

  • Switch to Reading View, select the whole note and copy, switch to Editing View, and paste over the whole note.

  • After making a backup, move the files out of the vault, change the .md filename extension to .html, and re-import as HTML.

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