Currently we allow the following HTML tags in comments.

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 href=""> Defines an anchor link
  • <strong> or <b> Defines bold text
  • <blockquote> Defines a long quotation
  • <em> or <i> Defines italic text
  • <strike> or <s> Defines strikethrough text
  • <p>  Defines a paragraph
  • <span>  Defines a section in a document
  • <caption> Defines a table caption
  • <cite> Defines a citation

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:

    var foo = 'bar';

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:

 <code class="javascript">
    var foo = 'bar';

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.

Spoiler tag

Disqus supports the ability to hide text in your comment using spoiler tags.

<spoiler>Hello, world</spoiler> Hides text until hovered over or clicked on

Related articles

Did this answer your question?