Fixes diff highlighting (#5199).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3619 e93f8b46-1217-0410-a6f0-8f06a7374b81
pull/351/head
Jean-Philippe Lang 15 years ago
parent 4524bc04e9
commit 4a51f10074
  1. 2
      lib/redmine/syntax_highlighting.rb
  2. 57
      public/stylesheets/scm.css

@ -46,7 +46,7 @@ module Redmine
# Highlights +text+ using +language+ syntax
# Should not return outer pre tag
def highlight_by_language(text, language)
::CodeRay.scan(text, language).html(:line_numbers => :inline)
::CodeRay.scan(text, language).html(:line_numbers => :inline, :wrap => :span)
end
end
end

@ -90,35 +90,39 @@ div.action_D { background: #f88 }
div.action_A { background: #bfb }
/************* CodeRay styles *************/
.syntaxhl div {display: inline;}
.syntaxhl .no { padding: 2px 4px 2px 4px; background-color: #eee; margin:0 }
.syntaxhl .code pre { overflow: auto }
.syntaxhl .debug { color:white ! important; background:blue ! important; }
.syntaxhl .af { color:#00C }
.syntaxhl .an { color:#007 }
.syntaxhl .at { color:#f08 }
.syntaxhl .av { color:#700 }
.syntaxhl .aw { color:#C00 }
.syntaxhl .bi { color:#509; font-weight:bold }
.syntaxhl .c { color:#666; }
.syntaxhl .c { color:#888; }
.syntaxhl .ch { color:#04D }
.syntaxhl .ch .k { color:#04D }
.syntaxhl .ch .dl { color:#039 }
.syntaxhl .cl { color:#B06; font-weight:bold }
.syntaxhl .cm { color:#A08; font-weight:bold }
.syntaxhl .co { color:#036; font-weight:bold }
.syntaxhl .cr { color:#0A0 }
.syntaxhl .cv { color:#369 }
.syntaxhl .de { color:#B0B; }
.syntaxhl .df { color:#099; font-weight:bold }
.syntaxhl .di { color:#088; font-weight:bold }
.syntaxhl .dl { color:black }
.syntaxhl .do { color:#970 }
.syntaxhl .dt { color:#34b }
.syntaxhl .ds { color:#D42; font-weight:bold }
.syntaxhl .e { color:#666; font-weight:bold }
.syntaxhl .en { color:#800; font-weight:bold }
.syntaxhl .er { color:#F00; background-color:#FAA }
.syntaxhl .ex { color:#F00; font-weight:bold }
.syntaxhl .ex { color:#C00; font-weight:bold }
.syntaxhl .fl { color:#60E; font-weight:bold }
.syntaxhl .fu { color:#06B; font-weight:bold }
.syntaxhl .gv { color:#d70; font-weight:bold }
@ -126,11 +130,13 @@ div.action_A { background: #bfb }
.syntaxhl .i { color:#00D; font-weight:bold }
.syntaxhl .ic { color:#B44; font-weight:bold }
.syntaxhl .il { background: #eee }
.syntaxhl .il .il { background: #ddd }
.syntaxhl .il .il .il { background: #ccc }
.syntaxhl .il .idl { font-weight: bold; color: #888 }
.syntaxhl .il { background: #ddd; color: black }
.syntaxhl .il .il { background: #ccc }
.syntaxhl .il .il .il { background: #bbb }
.syntaxhl .il .idl { background: #ddd; font-weight: bold; color: #666 }
.syntaxhl .idl { background-color: #bbb; font-weight: bold; color: #666; }
.syntaxhl .im { color:#f00; }
.syntaxhl .in { color:#B2B; font-weight:bold }
.syntaxhl .iv { color:#33B }
.syntaxhl .la { color:#970; font-weight:bold }
@ -140,9 +146,15 @@ div.action_A { background: #bfb }
.syntaxhl .op { }
.syntaxhl .pc { color:#038; font-weight:bold }
.syntaxhl .pd { color:#369; font-weight:bold }
.syntaxhl .pp { color:#579 }
.syntaxhl .pt { color:#339; font-weight:bold }
.syntaxhl .r { color:#080; font-weight:bold }
.syntaxhl .pp { color:#579; }
.syntaxhl .ps { color:#00C; font-weight:bold }
.syntaxhl .pt { color:#074; font-weight:bold }
.syntaxhl .r, .kw { color:#080; font-weight:bold }
.syntaxhl .ke { color: #808; }
.syntaxhl .ke .dl { color: #606; }
.syntaxhl .ke .ch { color: #80f; }
.syntaxhl .vl { color: #088; }
.syntaxhl .rx { background-color:#fff0ff }
.syntaxhl .rx .k { color:#808 }
@ -150,14 +162,15 @@ div.action_A { background: #bfb }
.syntaxhl .rx .mod { color:#C2C }
.syntaxhl .rx .fu { color:#404; font-weight: bold }
.syntaxhl .s { background-color:#fff0f0 }
.syntaxhl .s .s { background-color:#ffe0e0 }
.syntaxhl .s .s .s { background-color:#ffd0d0 }
.syntaxhl .s .k { color:#D20 }
.syntaxhl .s .dl { color:#710 }
.syntaxhl .s { background-color:#fff0f0; color: #D20; }
.syntaxhl .s .s { background-color:#ffe0e0 }
.syntaxhl .s .s .s { background-color:#ffd0d0 }
.syntaxhl .s .k { }
.syntaxhl .s .ch { color: #b0b; }
.syntaxhl .s .dl { color: #710; }
.syntaxhl .sh { background-color:#f0fff0 }
.syntaxhl .sh .k { color:#2B2 }
.syntaxhl .sh { background-color:#f0fff0; color:#2B2 }
.syntaxhl .sh .k { }
.syntaxhl .sh .dl { color:#161 }
.syntaxhl .sy { color:#A60 }
@ -170,3 +183,13 @@ div.action_A { background: #bfb }
.syntaxhl .ty { color:#339; font-weight:bold }
.syntaxhl .v { color:#036 }
.syntaxhl .xt { color:#444 }
.syntaxhl .ins { background: #cfc; }
.syntaxhl .del { background: #fcc; }
.syntaxhl .chg { color: #aaf; background: #007; }
.syntaxhl .head { color: #f8f; background: #505 }
.syntaxhl .ins .ins { color: #080; font-weight:bold }
.syntaxhl .del .del { color: #800; font-weight:bold }
.syntaxhl .chg .chg { color: #66f; }
.syntaxhl .head .head { color: #f4f; }

Loading…
Cancel
Save