Obsidian doesn’t parse RTF. I think there is paragraph there and even tabs.

Interesting – here are the different data types on the clipboard when copying that “Test” string:

The first two formats are both RTF, public.utf8-plain-text and NSStringPboardType are both plain text with just the four bytes on the clipboard, one for each character in the text I pasted, and the remaining two are both UTF-16 format strings.

Those UTF-16 format strings do look weird, but I’m no expert on that format. Here’s the clipboard contents for UTF-16, in hex:

ff fe 54 00 65 00 73 00 74 00

Any ideas? Perhaps Obsidian is trying to parse the UTF-16 clipboard contents and getting it wrong somehow? If it was parsing the UTF-8 contents, it wouldn’t be inserting any extra characters as they only contain the text itself:

54 65 73 74

Option+Shift+Command+V to paste text without any formatting

Option+Shift+Command+V to paste text without any formatting

Yes, that is a workaround, but the point is that there is no formatting applied to the text – it’s just plain text copied from another app. All other apps I paste that text into into handled it without a problem, but something is weird with Obsidian and it inserts extra characters that weren’t in the original text. So this is definitely a bug and should probably be fixed.

My guess is that this will be where the problem lies.

I don’t know that I’d interpret it this way. Have you tried pasting into other electron apps? Do any other programs give rise to similar problems in Obsidian or is it only Apple Notes and Reminders?

But whatever it is, it looks like something very particular and fiddly to diagnose and fix whichever side is causing the problems.

From the plist of the Notes app on a Mac:

			<string>Notes rich text pasteboard data</string>
			<key>UTTypeIconFiles</key>
			<array/>
			<key>UTTypeIdentifier</key>
			<string>com.apple.notes.richtext</string>

I believe Notes and Reminders use an Apple derivative of RTF, not plain text.

https://developer.apple.com/forums/thread/113322

Angel

I’d suggest testing with Zettlr. It’s also Electron and Codemirror based. Not sure of what it does with UTF. Or RTF.

Thanks, guys – I’ll try installing another Electron/CodeMirror app like Zettlr and test it there too.

I am gonna repeat, this is an html-to-md problem. The extra stuff is probably there in the RTF or the HTML generated from the RTF by apple/electron.

At the end of the day, it doesn’t matter if the problem is with UTF, RTF or HTML. Since paste text without formatting does work, we can deduce that there’s extra formatting being picked up by the ordinary Obsidian paste.

The issue is that some programs understand what they are being given and interpret it correctly and Obsidian doesn’t. I’m more than willing to see it as an issue at the Apple end, but if other apps with a similar stack to Obsidian can get it as intended, which we don’t know yet, then there a possibility of it being solved at the Obsidian end anyway. I can’t imagine Apple being willing to accept it as an issue that they will address.

It’s not that clear cut. The clipboard (on macOS anyway) is actually multiple clipboards with differently formatted versions. Pasting into an RTF based field is different to pasting into a plain text field.

In addition, Obsidian is also helpfully converting what’s pasted into MD so the results should be different to pasting into other apps.

Zettlr converts HTML to markdown using the Showdown library iirc (I don’t know what Obsidian uses), so I’d hope it would be a reasonable comparison with Obsidian.

I certainly don’t see it as simple and personally prefer to paste without formatting when I hit a problem between programs - trying to work out whether it’s a problem with clipboard, target or translation can become unproductive very quickly. I doubt it’s a bug in Obsidian itself, which is the original claim. The problem is likely to be somewhere upstream, and if no-one has spotted what it is by examining the clipboard content then the only way forward I see is testing for the boundaries of problem occurrence. The OP started, but it seems to need to become much finer grained.

I’m a bit surprised that other Apple Notes users haven’t reported similar issues, but don’t remember seeing them.

I finally had the chance to try Zettlr, and the behaviour there is even worse – pasting the string “Test” from Apple Reminders causes the following to be pasted:

  p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px '.AppleSystemUIFontRounded'; color: #000000; color: rgba(0, 0, 0, 0.85)} 

Test

Exactly the same thing happens when using the “Paste Without Styles” command in Zettlr, for some reason.

Anyway, I still say this is an issue with Obsidian as the end user’s experience of this makes it seem that Obsidian is buggy – pasting into LibreOffice, for example, doesn’t cause any additional characters to be inserted, and ditto for TextEdit, Bear, Google Docs, OmniGraffle, Apple Notes, Pages, Slack, Trello, etc (these are just the apps I happen to have on my computer).

Interestingly, DynaList also inserts an extra character when pasting from Apple Reminders, so something is amiss in Obsidian’s sister project too.

I also tried copying and pasting text from other apps into Obsidian:

  • Copying text from a code block in Slack, for example, causes extra newlines to appear, which again don’t appear in apps other than Obsidian.
  • Copying text from LibraOffice again causes those extra spaces and newlines to be inserted when pasting into Obsidian.
  • Pasting from Google Docs into Obsidian causes other weird characters to be inserted – in this case extra newlines and pairs of asterisks (and no, the original text wasn’t boldfaced).
  • Pasting from Omnigraffle also causes extra newlines and spaces to be inserted.

Basically, the interoperability of Obsidian with other apps on Mac leaves a lot to be desired, unfortunately…yes, you can work around it by remembering to use command-shift-V to paste without formatting, but most users won’t remember that and will (like I did) get annoyed at Obsidian’s inability to play nice with other apps in the Mac ecosystem…

You can use 3rd party apps to export data from Apple Notes

http://writeapp.net/notesexporter/

Let me know your results! Exporter may be the way to go

I’m not yet ready to migrate as I’m yet setting up my environment in Obsidian

Obsidian is still in its infancy, we didn’t reach version 1.0 yet.
Also, it’s open source and multi platform, i assume the developers didn’t have the time to focus on OS specific integration, like the integration with Macs services, or the build-in dictionaries. Finally, an integration with Applescript would be a dream!

Since a ton of people use Mac to run Obsidian, a later integration with Mac specific features should be on the horizon, imo.

1 Like

My gripe with your assessment is that this is a bug. The text is formatted so you should use paste without formatting. I don’t see this as a workaround.

I believe this is a valid feature request: handle MacOS RTF Clipboard format.

1 Like

@Jopp

Let me know your results! Exporter may be the way to go

That would work well if you have a whole bunch of notes in Apple Notes that you want to bring across. Unfortunately my use-case is different: I tend to write notes in Apple Notes using my phone and copy those individually into my Obsidian vault when I’m back at my computer. While I could theoretically write notes directly into Obsidian using Obsidian Mobile, I find it far quicker and easier to write in Notes and transfer afterwards (I edit the notes at the same time). That’s why I copy-and-paste into Obsidian…

Thanks for the idea, though!

Fair enough – it’s all in how you define a bug. To me, a bug is anything that doesn’t work the way users expect. But if you’d rather classify it as a feature request, that’s all good.

I see…what about Shortcuts ? you should be able to automate tedious tasks on your iOs tablets, since i do not own these devices i cant tell you more.

https://support.apple.com/de-de/guide/shortcuts/welcome/ios

So the reason why it works in all of those, is because they are “text only” fields and only uses the text/plain version that Apple Reminders properly export. I’m guessing what’s happening here is that Apple Reminders put out an RTF version that has the extra lines, which are kept into the HTML version that the browser engine converts to.

Try pasting into something like Google Docs. Also please try pasting into this clipboard tester page Clipboard Test (preferably with Chrome) and show us what the output looks like.

If Apple Reminders do in fact add the extra lines, then there isn’t anything we can do - you’d have to file a bug report with Apple.

From our perspective, we can’t really “strip” preceding empty lines because many people do actually copy text with empty lines before or after when reorganizing paragraphs, and stripping it would be a much bigger annoyance.

I suspect it “works” between Apple apps because they have some kind of workarounds for each other (or have specific parsers that understand that the input came from Apple Reminders and performs the necessary stripping).

2 Likes