gitlab-org--gitlab-foss/app/assets/javascripts/syntax_highlight.js

19 lines
466 B
JavaScript
Raw Normal View History

2016-07-24 16:45:11 -04:00
(function() {
$.fn.syntaxHighlight = function() {
var $children;
if ($(this).hasClass('js-syntax-highlight')) {
return $(this).addClass(gon.user_color_scheme);
} else {
$children = $(this).find('.js-syntax-highlight');
if ($children.length) {
return $children.syntaxHighlight();
}
}
};
$(document).on('ready page:load', function() {
return $('.js-syntax-highlight').syntaxHighlight();
});
}).call(this);