# 🇨🇳 Code syntax highlighting

**URL:** https://meta.discourse.org/t/code-syntax-highlighting/245387
**Category:** Administrators
**Tags:** chinese-translation, content
**Created:** [November 13, 2022, 12:51am UTC](https://meta.discourse.org/t/code-syntax-highlighting/245387 "2022-11-13T00:51:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![honeymoose](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/honeymoose/32/198718_2.png) [@honeymoose](https://meta.discourse.org/u/honeymoose)
#### Post date: [November 13, 2022, 12:51am UTC](https://meta.discourse.org/t/code-syntax-highlighting/245387/1 "2022-11-13T00:51:32Z")

</div>

Discourse natively supports syntax highlighting, using [highlight.js](https://highlightjs.org/) by default.

If your code isn’t highlighting correctly, you can force the language you want to use within the code block, like this:

````
``` ruby
3.times do |stuff|
  stuff.do
end
```

````

Which renders as:

```ruby
3.times do |stuff|
  stuff.do
end

```

The language you set must be available on the platform. You can check the language settings on your Discourse site by looking at the `highlighted_languages` configuration option.

If your posts still don’t display correctly, you’ll need to contact your site administrator.

 ![](https://global.discourse-cdn.com/meta/original/4X/7/2/8/728162a627f52bf90894463496dc65d44cc0c72d.png)

Discourse usually displays syntax highlighting with its default installation.

## No Syntax Highlighting

If you don’t want any syntax highlighting for your code, you can type the characters “text” after the code block:

````
``` text
Your text to NOT highlight here
```

````

```plaintext
Your text to NOT highlight here

```

As shown above.

Please refer to the original article [iSharkFly - 飞鲨](https://www.ossez.com/t/discourse/14200) for more information.

Thanks to the official support.
