Strange colors in markdown edit mode

Hi!

I have one markdown note file that I have been editing in iA Writer (my standard external editor). Strangely, in Devonthink, the text is displayed in three different colors, going from brown, blue, to black, in EDIT mode. There is no markup in the document that it should do this, just normal text. This happened after the latest update. I think it is a bug with the Wysiwyg option. It disappears when I untick Wysiwyg in preferences. The colors also disappear if I create a break at the beginning of the document or begin with a heading.

That being said; I’m very excited about the latest update and the improvements to the markdown editor. Now we only need automatic updates of markdown wikilinks across files :slight_smile: Then I can uninstall Obsidian forever.

What is the first character of the relevant file?

Stephen

The first character is A
in the word After

Ah, sorry, in that case: I don’t think that’s deeply significant! :grinning: Sorry not to be more helpful.

Stephen

1 Like

A screen capture would likely help.

Thanks!

Add a space at the top of the document. The colors change to normal again, correct?

Yep, it does!

Care to explain what’s going on?

Edit I see - the colon makes the first part to metadata.

Meaning: A colon in the first paragraph is interpreted as an indicator that the first paragraph is MultiMarkdown metadata (and should be invisible in rendered mode).

I still think there should be an option to ignore MMD metadata like in some MMD editors. Because sometimes a colon is just a colon.

If you want to use a colon in the first line you can escape it like so \:.

I know, I know. But it’s again something to consider when one just wants to write.

Actually I have taken measures (like Actions in Drafts, Smart Rules in DEVONthink) to automatically add empty lines to the beginning of each markdown note. So personally I’m good. But I still think there should be an option &c.

It’s simple enough to add an empty line at the top of the document without adding to our already lengthy preference panes :slight_smile:

Thanks for the clarification! I really appreciate this community!

I find this behavior a bit unpractical, though I now understand why it happens. I think quite a few people use DEVONthink for atomic notes, and a more clean behavior could be great.

You see the same behavior in MultiMarkdown Composer (and yes, we use MultiMarkdown in DEVONthink). There are no preferences to ignore MMD metadata in that application either. :slight_smile:

Why the smiley? The fact that the MultiMarkdown Composer created by the same person responsible for MultiMarkdown itself[1]—including its not very well thought out meta data specification—does not offer any option to turn off the not very well thought out meta data feature should be anything but surprising.[2]

And to explain “not very well thought out”: Markups in Markdown usually works with delimiters. With single opening delimiters when they affect paragraphs like headings (optional with a closing delimiter) or block quotes. With both opening and closing delimiters for inline markup like italics, etc.

In contrast to that MMD meta data works with a single character—a colon—somewhere in a paragraph. And only if the first paragraph of a text contains a colon and then that first paragraph and all its subsequent paragraphs as long as they continuously contain a colon are handled as meta data.

Merging texts with meta data changes meta data into standard text, which is annoying. Converting Markdown to, say, RTF, might delete paragraphs due to their position in a text and them containing a colon, which is really bad.

Of course, one could type \: instead of : but one should do that not only in the first paragraph but always. At least as long as one considers the possibility that rearranging paragraphs might be necessary at some point. And while a text might hold lots of colons it has only one meta data section.

A single delimiter, say, a line would allow an easy distinction between meta data and the text for both the writer/source code reader and the rendering algorithm.

Until MMD creator Fletcher Penney decides to change the meta data specification an option to turn MMD meta data off would come very handy.

And

happen to be not that long in the Markdown section.


[1] Which I in general like both.
[2] By the way it is somewhat covered by MMD Composer’s Limit to "Strict" Markdown functionality option.

Markdown had been invented to allow for a simple way to write formatted text. After there were already lots of not so simple ways like SGML, XML, and HTML. Also, Markdown is not standardized by an organization (while SGML, XML and HTML are). Which lead to what we see now

  • Several versions of Markdown (Multi, Critical, GitHub, whatnot)
  • On top of that, vendor-specific additions (think Obsidian)
  • None of them standardized and overseen by an impartial organization
  • all of them with various non-compatible features
  • all of them with functions added ad-hoc because users “needed” them (well, that’s something you can see all them time here, too)

So, the single colon metadata markup feature was invented by Fletcher, probably because people needed (or thought they needed) metadata right in their file (instead of, for example, using extended attributes). Now it’s there, people are using it, and others are bitten by it. That’s the way it goes. And I doubt that one could do anything about it right now.

That’s what Hugo does with its frontmatter:

---
author: me
date: 2022-07-04
summary: No idea
---

Makes things clear, of course. And should in fact also work with DT’s MultiMarkdown:

The metadata must begin at the very top of the document - no blank lines can precede it. There can optionally be a --- on the line before and after the metadata. The line after the metadata can also be .... This is to provide better compatibility with YAML, though MultiMarkdown doesn’t support all YAML metadata.

(taken from the documentation of MMD 4, we’re at version 6 now).

And apparently, it works in DT, too. Your wish has already come true.


3 Likes

The next release will improve the recognition of metadata headers in the editor.

1 Like