From 5290f0c71241580790d08cb32f36a4b0f4f18543 Mon Sep 17 00:00:00 2001 From: George Vinogradov Date: Mon, 5 Mar 2012 19:27:16 +0400 Subject: [PATCH] [issue #195] Fixed syntax highlighting. Stub for rpm-specs --- app/views/git/blobs/_show.html.haml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/git/blobs/_show.html.haml b/app/views/git/blobs/_show.html.haml index aba2703b4..3d720fb88 100644 --- a/app/views/git/blobs/_show.html.haml +++ b/app/views/git/blobs/_show.html.haml @@ -34,7 +34,7 @@ - when :text .gutter = render_line_numbers(text.length) - #output.formatted + #output.formatted.cm-s-default %pre#code =#{render_blob(@blob)} :preserve @@ -51,6 +51,6 @@
:javascript $(document).ready(function() { - var text = $('#code').innerHTML.replace(/&/gi, '&'); - CodeMirror.runMode(text, "#{@blob.mime_type}", document.getElementById("output")); + var text = $('#code').text().replace(/&/gi, '&'); + CodeMirror.runMode(text, "#{File.extname(@blob.name) == '.spec' ? 'text/x-rpm-spec' : @blob.mime_type}", document.getElementById("output")); });