# Markdown Code Block Bug with Paste

**URL:** <https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625>\
**Category:** DEVONthink\
**Created:** [September 11, 2026, 11:10pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625 "2026-09-11T23:10:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JBB](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@JBB](https://discourse.devontechnologies.com/u/JBB)\
**Post date:** [September 11, 2026, 11:10pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/1 "2026-09-11T23:10:36Z")

</div>

Create a code block using the ``` delimiters.

Type text within the delimiters: correct code block font is used. (Monospaced).

Paste text within the delimiters: it is not.

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [September 12, 2026, 5:54am UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/2 "2026-09-12T05:54:40Z")

</div>

Try pasting with `paste and apply style ` (or whatever the right term is here).  
Assuming that you’re talking about MD in edit view.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [September 12, 2026, 7:20am UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/3 "2026-09-12T07:20:14Z")

</div>

Which version of DEVONthink do you use and what exactly did you copy first in which app?

---

<div class="post-metadata">

**Author:** ![JBB](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@JBB](https://discourse.devontechnologies.com/u/JBB)\
**Post date:** [September 12, 2026, 4:52pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/4 "2026-09-12T16:52:38Z")

</div>

I’m on DEVONthink 4.4 (latest version). Here’s a video showing the issue. I’m pasting plain text into a plain text document. Not sure why this would require a special style.

---

<div class="post-metadata">

**Author:** ![rmschne](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/r/8baadc/32.png) [@rmschne](https://discourse.devontechnologies.com/u/rmschne)\
**Post date:** [September 12, 2026, 4:58pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/5 "2026-09-12T16:58:24Z")

</div>

from where did you copy the text into the clipboard, and did you use Menu : Edit → Paste, or Menu:Edit → Paste Match Style ?

---

<div class="post-metadata">

**Author:** ![JBB](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@JBB](https://discourse.devontechnologies.com/u/JBB)\
**Post date:** [September 12, 2026, 5:16pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/6 "2026-09-12T17:16:02Z")

</div>

I used ⌘V. Again, unless I’m missing something, I’m pasting into a plain text file so I don’t know why the “Match Style” option has relevance.

---

<div class="post-metadata">

**Author:** ![rmschne](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/r/8baadc/32.png) [@rmschne](https://discourse.devontechnologies.com/u/rmschne)\
**Post date:** [September 12, 2026, 5:49pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/7 "2026-09-12T17:49:48Z")

</div>

> [@JBB](#):
>
> I don’t know why the “Match Style” option has relevance.

it may not, but perhaps from where you copied from (still not answered) may be relevant.

That being said, I’ve tried what you report with DEVONthink 4.4 on macOS 26.6.2 and I’m not seeing what you report.

---

<div class="post-metadata">

**Author:** ![JBB](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/j/ccd318/32.png) [@JBB](https://discourse.devontechnologies.com/u/JBB)\
**Post date:** [September 12, 2026, 6:06pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/8 "2026-09-12T18:06:06Z")

</div>

Plain text from BBEdit.

---

<div class="post-metadata">

**Author:** ![Amontillado](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@Amontillado](https://discourse.devontechnologies.com/u/Amontillado)\
**Post date:** [September 13, 2026, 12:46pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/9 "2026-09-13T12:46:35Z")

</div>

I see the issue - sort of.

Either Command-V or Shift-Option-Command-V pastes in a different font than typing.

However, if I switch Devonthink’s editor to Preview, both look the same. If I switch the editor back to Source, the different font is gone. The pasted text is the same as the typed.

More text pasted in a new code block appears with the different font. I can open the document with BBEdit and see no extra characters and everything is in the same font BBEdit wanted to use.

I see the phenomenon with my alternate CSS file and with no alternate selected. I’m guessing leaving the style sheet blank in Devonthink-\>Settings-\>Files-\>Markdown reverts to the default style sheet.

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [September 13, 2026, 2:46pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/10 "2026-09-13T14:46:13Z")

</div>

The style sheet affects only preview mode. And preview mode should never display different fonts in a fenced code block unless you use a CSS that enforces different fonts. Apples = edit mode, oranges = preview mode. Different technology stacks.

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [September 13, 2026, 2:59pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/11 "2026-09-13T14:59:44Z")

</div>

Does your default stylesheet include `font-family` information?

---

<div class="post-metadata">

**Author:** ![Amontillado](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@Amontillado](https://discourse.devontechnologies.com/u/Amontillado)\
**Post date:** [September 13, 2026, 3:32pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/12 "2026-09-13T15:32:55Z")

</div>

An interesting question. ~/Library/Application Support/DEVONthink/StyleSheets is empty. I am absolutely certain I never deleted anything there, although I am a user and absolute certainty is probably always relative - but I don’t think I had anything there.

Erasing the stylesheet field in the Markdown settings changes back to what I used to see. I’m not sure where it’s picking up its styles.

A Finder search in ‘~/Library/Application Support/DEVONthink’ finds no filenames containing css. If I search the whole filesystem, I see plenty of \*.css files.

My custom, apparently workable, css file is outside of Application Support. I have it in a normal directory that gets synced to my laptop via Chronosync.

My body and code stanzas in my homebrew stylesheet each have a font-family specification.

---

<div class="post-metadata">

**Author:** ![BLUEFROG](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/bluefrog/32/135_2.png) [@BLUEFROG](https://discourse.devontechnologies.com/u/BLUEFROG)\
**Post date:** [September 13, 2026, 3:45pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/13 "2026-09-13T15:45:09Z")

</div>

I am not seeing the behavior here so it’s not some inherent issue across all Macs. We’ll have to think on this more.

---

<div class="post-metadata">

**Author:** ![chrillek](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chrillek/32/29340_2.png) [@chrillek](https://discourse.devontechnologies.com/u/chrillek)\
**Post date:** [September 13, 2026, 5:13pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/14 "2026-09-13T17:13:26Z")

</div>

Perhaps a screenshot might show what you see more clearly. Note that the OP was clearly experiencing the problem _in edit mode_. Which has nothing to do with CSS.

---

<div class="post-metadata">

**Author:** ![Amontillado](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@Amontillado](https://discourse.devontechnologies.com/u/Amontillado)\
**Post date:** [September 13, 2026, 6:39pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/15 "2026-09-13T18:39:04Z")

</div>

Here’s what I see:

Not having to do with CSS makes sense, because the document appears to be in good shape all along. It’s just the font used for display in edit mode for pasted text is unexpected.

---

<div class="post-metadata">

**Author:** ![Amontillado](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@Amontillado](https://discourse.devontechnologies.com/u/Amontillado)\
**Post date:** [September 13, 2026, 6:42pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/16 "2026-09-13T18:42:45Z")

</div>

How odd - I tried to edit in a comment that not having to do with CSS makes sense. The document is in good shape all along, it’s just the font used in edit mode for paste is unexpected.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [September 14, 2026, 10:03am UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/17 "2026-09-14T10:03:08Z")

</div>

The next release will fix this.

---

<div class="post-metadata">

**Author:** ![Amontillado](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/a/e47c2d/32.png) [@Amontillado](https://discourse.devontechnologies.com/u/Amontillado)\
**Post date:** [September 14, 2026, 4:20pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/18 "2026-09-14T16:20:07Z")

</div>

And there you have it, the best customer service ever!

---

<div class="post-metadata">

**Author:** ![Chazzo](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/chazzo/32/6301_2.png) [@Chazzo](https://discourse.devontechnologies.com/u/Chazzo)\
**Post date:** [September 29, 2026, 1:40pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/19 "2026-09-29T13:40:45Z")

</div>

Thank you! I think the above discussion was about code blocks, but I’ve seen the same behaviour in MD headings too (wrong font size after pasting in plain text from BBEdit). It corrects itself in due course, including after using an external editor.

On the subject of code blocks, I’ve just been caught out by an automatic curly quote. I love smart quotes, but if there’s a way to keep them straight within code blocks that would be great.

---

<div class="post-metadata">

**Author:** ![cgrunenberg](https://discourse.devontechnologies.com/user_avatar/discourse.devontechnologies.com/cgrunenberg/32/7172_2.png) [@cgrunenberg](https://discourse.devontechnologies.com/u/cgrunenberg)\
**Post date:** [September 29, 2026, 2:17pm UTC](https://discourse.devontechnologies.com/t/markdown-code-block-bug-with-paste/87625/20 "2026-09-29T14:17:24Z")

</div>

> [@Chazzo](#):
>
> but I’ve seen the same behaviour in MD headings too (wrong font size after pasting in plain text from BBEdit). It corrects itself in due course, including after using an external editor.

This will be fixed too but it’s a different issue (visual glitch vs. jumping scroll position)
