Skip to content
A jQuery plugin for supporting Markdown and syntax highlighting in Disqus comments.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

This jQuery plugin enhances your Disqus comments with Markdown and syntax highlighting.


Include appropriate dependencies in your <head>:


Then configure Disqus and run the plugin from anywhere:

$(document).ready(function() {
  /* We do not change the Disqus API. If you want to pass options to
   * Disqus, do it like they expect: by setting global variables. */
  disqus_shortname  = "example";
  disqus_identifier = "/path/to/slug";


Be aware that the Disqus embed script manipulates comments, e.g., changing long URLs into anchor elements (<a>) or newlines into line-break elements (<br>). These manipulations must be reversed for the original Markdown to parse as the comment author intended. I have made a minor attempt to address these two specific manipulations, but there are others that my script will not handle correctly.

An ideal solution would essentially require rewriting the Disqus embed script and replacing the transformation that Disqus provides. I suspect it would be an easy change for Disqus developers with access to the source. For me, it is too much reverse engineering to be justified.

I have not tested this script with Disqus 2012. My suspicion is that browsers will prohibit its access to the comments within the Disqus iframe, thus disabling it.


This plugin was branched off the last published version of the jQuery Disqus plugin by Lance Pollard. Besides being broken by the time I discovered it (likely due to changes in the Disqus API), I believe the original plugin tried to do too much. I have made several changes:

  • Use a single entry point, $.disqus().
  • Expect Disqus configuration to occur outside the call to this plugin and to follow the expectations documented by Disqus.
  • Use Disqus's published Universal Code instead of a custom AJAX call.
  • Support Markdown conversion using Showdown.
  • Support syntax highlighting with Prettify.
  • Remove everything else, e.g. ready() and add().
You can’t perform that action at this time.