Markdown editor display glitch

When I open a markdown document in two panes view, the editing pane would sometimes display incorrectly: the last paragraph of text is given a partly overlapping “shadow” (see screenshot below as an example). Preview pane is rendered correctly.

  • This glitch happens to some (personal estimate is 10%), but not all, of my markdown documents. It seems that documents without headings are particularly prone to the glitch.
  • This glitch is language agnostic: I have documents in either of two languages (Chinese and English), and it happens to both.
  • This glitch occurs with WYSIWYG editing toggle either ON or OFF.
  • The display glitch would disappear when I make an edit anywhere (not only the last paragraph) in the document.

Plain Text Font used in screenshot: SF Pro Text Light 14. Using other fonts did not solve this issue for me, either.

In my memory, this glitch has been present for as long as I have been using DT. Both rebooting the device and restarting DT did not work, nor did a fresh system reinstallation this January.

DEVONthink Pro 3.9.6, macOS 14.4.1.
Document used in the screenshot: example.zip (1.1 KB)

Another, perhaps unrelated, markdown editor glitch, when using a Plain Text Font without provision for Chinese characters (e.g. Arial)

When pasting plain text including both Latin and Simplified Chinese characters, the entirety of the pasted text would sometimes, but not always, appear in PingFang SC font (system font for Simplified Chinese). Even though the Latin part of the pasted text is supposed to be displayed in the Plain Text Font designated in app settings.

See how the link in screenshot below is displayed in a different font from other text in editor:

This (minor) display glitch can be solved by closing and reopening the document.

If it’s not related to WYSIWYG, then it’s most likely one of the many (temporary) display glitches of macOS’ text engine. Especially in the last few years I notice these glitches more often than not in TextEdit too after pasting.

Does this also happen in TextEdit when using the same font and pasting the same data?

I’m unable to reproduce the “incorrect font” issue in TextEdit. On the other hand, I’ve discovered some interesting behaviors:

1) The “shadow” glitch can happen in Script Editor, too. See screenshot below.

Therefore your presumption that …

… seems about right.

2) I’ve found a way to consistently reproduce the “incorrect font” glitch in DT, through the following steps:

  1. Create a new markdown document
  2. Paste this into the document as plain text: 测试 this is some text
  3. Select the Chinese characters 测试 (this step is critical)
  4. Run this simple script: tell application id "DNtp" to set selected text of think window 1 to "测试 this is some text"

And you will see the font difference between the two “this is some text”.

However, if I run set the clipboard to "测试 this is some text" and paste manually at step 4, the paste text will be of correct font (Chinese in PingFang SC, English in PTF).

I’m not aware of an equivalent of DT’s selected text in TextEdit, therefore cannot make the same comparison in TextEdit.