Enable QML syntax highlighting

It would be nice to have QML syntax highlighting in code snippets. Apparently the list can be edited “here”: Configure which programming languages are available for syntax highlighting - admins - Discourse Meta

The list of languages can be found here:
https://highlightjs.readthedocs.io/en/latest/supported-languages.html

Test {
   id: "test"
}

would be most important but there is also rpm available.

The syntax highlighting can then be specified like this (or it will try to guess)

``` qml

Edit: it seems one needs to “touch” old posts once to retrospectively enable the formatting

6 Likes

Thanks for the suggestion, apparently nobody had reviewed that setting and it was in it’s default value :slight_smile:

Updated the list of highlighted languages to match more what is relevant for Sailfish OS.
From the ones you mention included qml, but rpm spec was not available. Probably the highlightjs version is not new enough or something…

It seems additional languages can be added as theme components, but this does not seem to work on the version of discourse we currently have. Need to check back in the future.

Test QML snipppet

Test {
   id: "test"
}

Test RPM spec

Name: test
Version: 0.1
Source0: %{name}-%{version}.tar.gz

%description
Test spec highlight
9 Likes