# Markdown syntax highlighting in post editor

**URL:** https://meta.discourse.org/t/markdown-syntax-highlighting-in-post-editor/282665
**Category:** Feature
**Tags:** composer
**Created:** [October 18, 2023, 4:49pm UTC](https://meta.discourse.org/t/markdown-syntax-highlighting-in-post-editor/282665 "2023-10-18T16:49:00Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [October 19, 2023, 12:24am UTC](https://meta.discourse.org/t/markdown-syntax-highlighting-in-post-editor/282665/10 "2023-10-19T00:24:34Z")

</div>

Just to expand, first that this is something I really want core to support but also worth expanding on the complexity.

Discourse core uses many many APIs against TEXTAREA directly, `@mentions`, toolbar inserts stuff into the TEXTAREA, uploads, cut and paste images and more.

This is all not abstracted away and assumes it is talking to a TEXTAREA. Adding a contenteditable there direct would mean it would need to also properly and very accurately simulate a TEXTAREA, something that is likely to fail. We need a fair amount of work to create some sort of provider framework so we can swap things in.

See also:

> [@More advance editor should be here?](https://meta.discourse.org/t/more-advance-editor-should-be-here/14102):
>
> I have some exprence in taking notes of math in the Editor: [StackEdit](https://stackedit.io/), while the discouse editor (what’s her name?) is my first forum editor that support markdown and mathjax at the same time with perfect preview, it seems that there are still have some space to make it more perfect, compare with StackEdit: a table of content guide of a rather length topic: in stackedit, we can just put a shortcode called [toc] to make a table of content with links the particial render of mathjax is also qu…

> [@Who would prefer a standard wysiwyg to markdown?](https://meta.discourse.org/t/who-would-prefer-a-standard-wysiwyg-to-markdown/31340):
>
> I just saw an interview with Michael Pryor of trello: At one point he says: We added markdown in Trello which in retrospect, was a mistake because it’s a developer centric feature in a non developer focused product. We overcame it by adding guidance on how to use markdown within the app, but users sometimes still get confused. I’m curious to know what the feeling out there is about the use of markdown in Discourse. Am I the only one who thinks discourse would appeal to many more people i…

Highlighter is certainly a great first move in this direction cause you don’t have to worry about bi-directional markdown to text mapping.

There may be some ninja hack where you can hide the TEXTAREA and then render a contenteditable on top of it, ferrying events to the original, but even that would require a re-implementation of `@mention` positioning.

---

_[View the full topic](https://meta.discourse.org/t/markdown-syntax-highlighting-in-post-editor/282665)._
