pbek / QOwnNotes

QOwnNotes is a plain-text file notepad and todo-list manager with Markdown support and Nextcloud / ownCloud integration.
https://www.qownnotes.org/
GNU General Public License v2.0
4.62k stars 410 forks source link

[FEATURE] Add console block highlight #3094

Open alexminder opened 3 weeks ago

alexminder commented 3 weeks ago

Is your feature request related to a problem? Please describe.

There no code highlight for console content. Bash,shell and console is not the same.

Describe the solution you'd like

For example, Github render engine supports console block identifier:

```console
foo@bar:~$ whoami
foo
```

image

It listed in https://github.com/github-linguist/linguist/blob/master/lib/linguist/languages.yml#L6782

pbek commented 3 weeks ago

The code block highlighting is part of https://github.com/pbek/qmarkdowntextedit.

You could look at the bash highlighting and use that as a starting point: https://github.com/pbek/qmarkdowntextedit/blob/48d602b174ac5f6600149b3874b00a01553bda94/markdownhighlighter.cpp#L336

The last language contribution was this commit, it could also serve as a good example of what to do: https://github.com/pbek/qmarkdowntextedit/commit/8157cd6f14b64d806605a11c8ff98d848ed18c2c