From ef5878cf11e52bd95aa3f8d988ebee5122ca9202 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Mon, 6 Jul 2009 15:30:35 -0500 Subject: [PATCH] Put class name on
, rather than 

Better CSS styling options ensue, if we put
the class='lang' on the 
 element.

(Suggested by Casper Gripenberg)
---
 public/s5/ui/core/math.css                    | 52 +++++++++----------
 public/stylesheets/instiki.css                | 52 +++++++++----------
 .../maruku/lib/maruku/output/to_html.rb       |  4 +-
 3 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/public/s5/ui/core/math.css b/public/s5/ui/core/math.css
index 6e4e4d8b..4c0efab9 100644
--- a/public/s5/ui/core/math.css
+++ b/public/s5/ui/core/math.css
@@ -41,30 +41,30 @@ span.theorem_label {font-style:normal; font-weight:bold;}
 .num_note .theorem_label:after {
    content: " " counter(note); counter-increment: note;}
 
-code.ruby .normal {}
-code.ruby span.attribute { color: #090; }
-code.ruby span.char { color: #F00; }
-code.ruby span.class { color: #A020F0; font-weight: bold; }
-code.ruby span.comment { color: #00F; }
-code.ruby span.constant { color: #008B8B; }
-code.ruby span.escape { color: #6A5ACD; }
-code.ruby span.expr { color: #22C; }
-code.ruby span.global { color: #1A4; }
-code.ruby span.ident { color: #004; }
-code.ruby span.keyword { color: #A52A2A; font-weight: bold; }
-code.ruby span.method { color: #008B8B; }
-code.ruby span.module { color: #A020F0; font-weight: bold; }
-code.ruby span.number { color: #D0D; }
-code.ruby span.punct { color: #6A5ACD; }
-code.ruby span.regex { color: #D0D; }
-code.ruby span.string { color: #D0D; }
-code.ruby span.symbol { color: #008B8B; }
+pre.ruby .normal {}
+pre.ruby span.attribute { color: #090; }
+pre.ruby span.char { color: #F00; }
+pre.ruby span.class { color: #A020F0; font-weight: bold; }
+pre.ruby span.comment { color: #00F; }
+pre.ruby span.constant { color: #008B8B; }
+pre.ruby span.escape { color: #6A5ACD; }
+pre.ruby span.expr { color: #22C; }
+pre.ruby span.global { color: #1A4; }
+pre.ruby span.ident { color: #004; }
+pre.ruby span.keyword { color: #A52A2A; font-weight: bold; }
+pre.ruby span.method { color: #008B8B; }
+pre.ruby span.module { color: #A020F0; font-weight: bold; }
+pre.ruby span.number { color: #D0D; }
+pre.ruby span.punct { color: #6A5ACD; }
+pre.ruby span.regex { color: #D0D; }
+pre.ruby span.string { color: #D0D; }
+pre.ruby span.symbol { color: #008B8B; }
 
-code.xml .normal {}
-code.xml .namespace { color: #D66; font-weight: bold; }
-code.xml .tag { color: #F55; }
-code.xml .comment { color: #070; font-style: italic; }
-code.xml .punct { color: #449; font-weight: bold; }
-code.xml .string { color: #949; }
-code.xml .number { color: #F99; }
-code.xml .attribute { color: #771; }
+pre.xml .normal {}
+pre.xml .namespace { color: #D66; font-weight: bold; }
+pre.xml .tag { color: #F55; }
+pre.xml .comment { color: #070; font-style: italic; }
+pre.xml .punct { color: #449; font-weight: bold; }
+pre.xml .string { color: #949; }
+pre.xml .number { color: #F99; }
+pre.xml .attribute { color: #771; }
diff --git a/public/stylesheets/instiki.css b/public/stylesheets/instiki.css
index 33c8a71a..1b8e45e8 100644
--- a/public/stylesheets/instiki.css
+++ b/public/stylesheets/instiki.css
@@ -448,30 +448,30 @@ span.theorem_label {font-style:normal; font-weight:bold;}
 .num_note .theorem_label:after {
    content: " " counter(note); counter-increment: note;}
 
-code.ruby .normal {}
-code.ruby span.attribute { color: #090; }
-code.ruby span.char { color: #F00; }
-code.ruby span.class { color: #A020F0; font-weight: bold; }
-code.ruby span.comment { color: #00F; }
-code.ruby span.constant { color: #008B8B; }
-code.ruby span.escape { color: #6A5ACD; }
-code.ruby span.expr { color: #22C; }
-code.ruby span.global { color: #1A4; }
-code.ruby span.ident { color: #004; }
-code.ruby span.keyword { color: #A52A2A; font-weight: bold; }
-code.ruby span.method { color: #008B8B; }
-code.ruby span.module { color: #A020F0; font-weight: bold; }
-code.ruby span.number { color: #D0D; }
-code.ruby span.punct { color: #6A5ACD; }
-code.ruby span.regex { color: #D0D; }
-code.ruby span.string { color: #D0D; }
-code.ruby span.symbol { color: #008B8B; }
+pre.ruby .normal {}
+pre.ruby span.attribute { color: #090; }
+pre.ruby span.char { color: #F00; }
+pre.ruby span.class { color: #A020F0; font-weight: bold; }
+pre.ruby span.comment { color: #00F; }
+pre.ruby span.constant { color: #008B8B; }
+pre.ruby span.escape { color: #6A5ACD; }
+pre.ruby span.expr { color: #22C; }
+pre.ruby span.global { color: #1A4; }
+pre.ruby span.ident { color: #004; }
+pre.ruby span.keyword { color: #A52A2A; font-weight: bold; }
+pre.ruby span.method { color: #008B8B; }
+pre.ruby span.module { color: #A020F0; font-weight: bold; }
+pre.ruby span.number { color: #D0D; }
+pre.ruby span.punct { color: #6A5ACD; }
+pre.ruby span.regex { color: #D0D; }
+pre.ruby span.string { color: #D0D; }
+pre.ruby span.symbol { color: #008B8B; }
 
-code.xml .normal {}
-code.xml .namespace { color: #D66; font-weight: bold; }
-code.xml .tag { color: #F55; }
-code.xml .comment { color: #070; font-style: italic; }
-code.xml .punct { color: #449; font-weight: bold; }
-code.xml .string { color: #949; }
-code.xml .number { color: #F99; }
-code.xml .attribute { color: #771; }
+pre.xml .normal {}
+pre.xml .namespace { color: #D66; font-weight: bold; }
+pre.xml .tag { color: #F55; }
+pre.xml .comment { color: #070; font-style: italic; }
+pre.xml .punct { color: #449; font-weight: bold; }
+pre.xml .string { color: #949; }
+pre.xml .number { color: #F99; }
+pre.xml .attribute { color: #771; }
diff --git a/vendor/plugins/maruku/lib/maruku/output/to_html.rb b/vendor/plugins/maruku/lib/maruku/output/to_html.rb
index 62a12665..792c2c84 100644
--- a/vendor/plugins/maruku/lib/maruku/output/to_html.rb
+++ b/vendor/plugins/maruku/lib/maruku/output/to_html.rb
@@ -574,10 +574,10 @@ and
 				
 				code = Document.new(html, {:respect_whitespace =>:all}).root
 				code.name = 'code'
-				code.attributes['class'] = lang
 				code.attributes['lang'] = lang
-				
+							
 				pre = Element.new 'pre'
+				pre.attributes['class'] = lang
 				pre << code
 				pre
 			rescue LoadError => e