仅采用 Markdown 编辑器中的等宽字体

Hunh, we completely missed this brouhaha on our programming language community Discourse because we haven’t enabled the rich text editor. We still see the “legacy” behavior with the serif font in the markdown editor, and I’m quite happy with that behavior.

As someone who personally writes a lot of markdown and code (in monospaced editors and in many HTML text boxes), I have thoughts.

I quite prefer using a serif font in a non-RTE to author discourse posts. I’m sure there’s some change-aversion behind that, but I think there’s also some good reasons. Most text that I write on Discourse and GitHub is actually text, not code. In fact, I wouldn’t call markdown “code” at all! The only time I want for a monospaced font in this text editor window (or GitHub’s) is inside ``` fences — because that is code. Don’t conflate markdown with code; it’s not code. And I dislike rich text editors because they so often fight against me. For example, this very paragraph is getting some wildly buggy behaviors after flailing about to write the markdown for the fence (it’s just ```` ``` ````, but now I can’t touch tilde on my keyboard anymore without messing up the RTE).

Serif fonts in a non-RTE also matches GitHub — the other site with an HTML textbox where I write a lot of markdown.


I’d wager that this is representative of much of our programming community at large. The folks on our discourse board:

  • Write source code and use monospace fonts to write source code
  • Know how to write and read markdown directly
  • Don’t think of markdown text as source code
  • Likely prefer using non-RTEs
  • Likely prefer to type/edit it as prose — so with a serif font

Of course, this is quite a very specialized community and is not representative in any way. But my main point is: don’t do this for “programmers” because “they like monospace to code”.

7 个赞