1 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 * JSON syntax highlighting transformation plugin
5 AJAX.registerOnload('transformations/json.js', function () {
6 var $elm = $('#page_content').find('code.json');
7 $elm.each(function () {
9 var $pre = $json.find('pre');
10 /* We only care about visible elements to avoid double processing */
11 if ($pre.is(':visible')) {
12 var $highlight = $('<div class="json-highlight cm-s-default"></div>');
13 $json.append($highlight);
14 CodeMirror.runMode($json.text(), 'application/json', $highlight[0]);