Thanks!
The official doc says:
By default, Discourse will try to automatically detect what language you are typing and style your code accordingly. This might be nice for sharing code, but tends to produce strange results when sharing other preformatted text. To avoid the automatic styling, declare your code to be âraw textâ by typing text
after the first 3 back ticks.
In addition to text
, you can choose a number of other languages. The default list can be found on GitHub . Site admins can add or remove from the list to customize it for their site.
The default list consists of the following entries:
apache, bash, cs, cpp, css, coffeescript, diff, xml, http, ini, json, java, javascript, makefile, markdown, nginx, objectivec, ruby, perl, php, python, sql, handlebars
So Discourse tried to recognize the programming language in my code by itself and therefore sometimes switched back and forth between different formattings.
Formatting with âcppâ oder âjavaâ seems to work best for Overpass-Queries because comments are recognized correctly:
[out:json][timeout:25];
// gather results
(
// query part for: â"tiger:county"="Calvert, MD" and "tiger:reviewed"=*â
way["tiger:county"="Calvert, MD"]["tiger:reviewed"];
);
// print results
out geom;
@Map_HeRo Maybe include this in your Discourse-Formatting-Guide in the chapter about codeblocks?
@nukeador Maybe a custum entry could be added to the list of possible languages, something like âoverpassâ or âqlâ. Or the default format could be changed to something like this. Overpass-Queries will be by far the most shared code in this forum. But I guess this is more something for a minor feature-request rather than a site-issue⊠Anyways, thanks again.