Text Editor Blues - color syntax highlighting and single small column

I often find myself using an alternative text editor to edit messages, rather then Discourse’s built-in text editor.

Biggest issue I have is the size-restricted column is the middle of the screen. For editing, this is frustrating, as I have to scroll horizontally quite often. For rendering, especially on a desktop, is not the best experience, as there’s a lot of unused white space. Regardless how far you stretch the window, you only get this very slim column in the center of the browser window.

Another issue is the color syntax highlighting. It doesn’t render color syntax consistently. For a yaml, in our server (2.5.0.beta7), if I add a - list item, color syntax turns off, but if only key: value, this works. It seems to work on Discourse. For PowerShell, this works for us, but on Discourse, PowerShell syntax doesn’t work.

1 Like

Composer width is of similar size of the post width, so you have an idea of line length while typing.

You can increase both widths with some simple CSS theme-component. The defaults we ship are based on UX scientific studies.

You can force a specific language syntax by adding it’s name on the opening 3 back ticks, as defined in the Commonmark specification.

Example:

```yaml
list:
  - a: 1
  - b: "2"
```

becomes

list:
  - a: 1
  - b: "2"

Check your highlighted languages. Powershell is not on the default list.

2 Likes

We are using the triple back ticks with the language. I do this all the time on github. But doesn’t seem to work predictably.

1 Like

Can you share an actual example of a post where the highlight is failing?

2 Likes