Syntax highlighting

Disqus supports automatic syntax highlighting in a number of languages. To use this feature, place your code inside <pre><code> tags. For example:

<pre><code>
var foo = 'bar';
alert('foo');
</code></pre>

By default, Disqus will try to automatically detect the language. It's pretty good at this, but you can give it a hand by doing the following:

<pre><code class="javascript">
var foo = 'bar';
alert('foo');
</code></pre>

Supported languages

  • Bash
  • Diff
  • JSON
  • Perl
  • C#
  • HTML/XML (Note: You must first HTML-encode these tags to display them)
  • Java
  • Python
  • C++
  • HTTP
  • JavaScript
  • Ruby
  • CSS
  • Ini
  • PHP
  • SQL
Note: Syntax highlighting will automatically close tags. To place a tag in code without closing, use &#60; and &#62; instead of < and >, to override this behavior.

Related articles

Ask the Community

Still need help? Discuss Disqus is our most active place for getting quick help, sharing feedback, and discussing issues with others – a knowledgeable and helpful support team and community are there right now. Our 101 post is the best place to get started.

Make sure to search our Knowledge Base first... your answer might be just a click away!