Copy existing Markdown and Paste into Bear is losing some formatting

I’ve been observing an issue that comes up regularly, but intermittently, not consistently every time… When copying Markdown text from another source, the pasting it into Bear, Bear is losing or munging some of the formatting… Artifacts of this I’m seeing include:

Downgrading or fully dropping heading tags; e.g. a ## Heading 2 Text gets pasted into Bear and shows up has H1; or the ###{space}Text drops the heading tags entirely and the resulting paste shows up as plain text with a leading space like {space}Text. Sometimes, even when it interprets the Heading correctly (i.e. H2 stays H2), it still renders a leading space, {space}Text.

An empty line that is just a line-break; e.g. extra space between two paragraphs, get converted to 1-2 spaces. e.g. copying from a source that looks like this:

Lorem ipsum dolor sit amet.
{blank line, no spaces, no tabs}
Consectetur adipiscing elit.

… when pasted into Bear from an outside source ends up in Bear as:

Lorem ipsum dolor sit amet.
{space}{space}
Consectetur adipiscing elit.

I’m also seeing things like copying code quotes or code blocks and pasting them into Bear seem to intermittently drop the ticks/quotes and the result in Bear winds up being normally formatted text instead of code/code-blocks.

I’m mostly seeing these kind of oddities in my workflow when I do things like:

  • Copy a response from Claude or ChatGPT (either clicking the “Copy Response” button to copy the entire response, or when I selectively highlight text and copy specific snips).
  • Copying notes generated by Granola.ai which are formatted as markdown. I can paste them into TextEdit and verify the plain text view of the Markdown syntax is exactly as I expect it to be. I also get different results if I copy & paste from Granola.ai direct to Bear, vs. from Granola.ai to TextEdit to Bear. Neither results in a perfect copy & paste, and they both generate different sets of oddities.
  • When working with a Markdown Text file (e.g. one I’ve created directly myself in MarkEdit, or one that was originally generated by Claude that I downloaded as a file), copying & pasting snips of the doc into Bear Notes will have issues.

Bear isn’t perfect at parsing Markdown. The problems for me mostly show up when pasting from AI output, like ChatGPT, especially tables (see Pasting Chat GPT Tables ).

I’ve spent some time trying to workarounds. None are perfect either, and it depends on the source. With ChatGPT, it can even be different with the web and Mac interfaces.

Here are a few ways I have tried on Bear Mac with mixed success, all of which are annoying:

  • Experimenting with Edit>Paste From> again while also experimenting with the source and method of content.
  • Copying smaller chunks of conversations
  • Round tripping through other apps that parse Markdown differently.

I have no idea how difficult it is to get parsing right, but I suspect there are a lot of edge cases. Hopefully pasting from big boys like Claude and ChatGPT gets better treatment one of these days.

Hello,

Regarding the above: if you open TextEdit, press Cmd–Shift–T to switch to rich text mode, and paste the same content, do you get a similar result?

I guess that this is the same underlying issue in both ChatGPT and Granola. When present, Bear uses the rich-text clipboard entry and converts it to Markdown. However, the behavior you’re describing doesn’t seem to originate from that conversion step, which suggests the rich-text data in the clipboard may be malformed.

If the result in TextEdit’s Plain Text mode is correct, using Paste From > Plain Text in Bear should produce the expected result.

Thanks for the reply.

When I was giving the example of using TextEdit, I was referring to TextEdit in Plain Text mode, not Rich Text mode.

I tried the direct copy from Granola, then Paste From > Plain Text in Bear and got the same result as going from Granola-to-TextEdit-to-Bear.

I haven’t tried from ChatGPT or Claude direct to Bear yet, but if it behaves differently than this, I’ll reply here again.

So it seems like an issue somewhere along the chain of Markdown to Rich Text Clipboard to Markdown translation.