What HTML tags are allowed within comments?

Currently we allow the following HTML tags in comments. To learn what they do, take a look at the W3C's HTML elements reference.

Single tags

These tags can be used alone and don't need an ending tag.

  • <br> Defines a single line break

Matching tags

These require an ending tag, e.g., <i>italic text</i>

  • <a> Defines an anchor
  • <strong> Defines bold text
  • <blockquote> Defines a long quotation
  • <caption> Defines a table caption
  • <cite> Defines a citation
  • <em> Defines italic text
  • <p> Defines a paragraph
  • <span> Defines a section in a document
  • <s> Defines strikethrough text
  • <strike> Defines strikethrough text
  • <u> Defines underlined text

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

Post a public question in one of our community channels to get help from other Disqus users. Also, be sure to search our Knowledge Base first, your answer might be just a click away!

Discuss Disqus –– Great for getting quick help, sharing feedback, and discussing issues with the community and Disqus help team.

Q&A –– Great for asking very specific questions about how Disqus works