blob: 1905684fd446f7a4cac628e3605ada49a1f69611 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/**
* XML syntax highlighting transformation plugin
*/
window.AJAX.registerOnload('transformations/xml.js', function () {
var $elm = $('#page_content').find('code.xml');
$elm.each(function () {
var $json = $(this);
var $pre = $json.find('pre');
/* We only care about visible elements to avoid double processing */
if ($pre.is(':visible')) {
var $highlight = $('<div class="xml-highlight cm-s-default"></div>');
$json.append($highlight);
window.CodeMirror.runMode($json.text(), 'application/xml', $highlight[0]);
$pre.hide();
}
});
});
|