[DRE-commits] [ruby-org] 154/303: Change the tags used when colorizing code syntax: - Default and Coderay use a <pre> tag with the "src-#{lang}" css class like the elisp exporter - Pygments uses a <div> tag with the "highlight" css class

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:33:48 UTC 2013


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-org.

commit 978e73fe0fb35349daa1f714677dad660c98f11f
Author: Waldemar Quevedo <waldemar.quevedo at gmail.com>
Date:   Thu Jun 21 00:58:42 2012 +0900

    Change the tags used when colorizing code syntax:
    - Default and Coderay use a <pre> tag with the "src-#{lang}" css class like the elisp exporter
    - Pygments uses a <div> tag with the "highlight" css class
---
 lib/org-ruby/html_output_buffer.rb                 |   37 ++++++-----
 .../advanced-code-coderay.html                     |   60 ++++-------------
 .../advanced-code-no-color.html                    |   22 ++-----
 .../advanced-code-pygments.html                    |   68 +-------------------
 .../code-coderay.html                              |    4 +-
 .../code-no-color.html                             |    8 +--
 .../code-pygments.html                             |    8 ---
 7 files changed, 43 insertions(+), 164 deletions(-)

diff --git a/lib/org-ruby/html_output_buffer.rb b/lib/org-ruby/html_output_buffer.rb
index a58de14..a4437e1 100644
--- a/lib/org-ruby/html_output_buffer.rb
+++ b/lib/org-ruby/html_output_buffer.rb
@@ -65,15 +65,14 @@ module Orgmode
       if ModeTag[mode] then
         output_indentation
         css_class = ""
-        css_class = " class=\"src\"" if mode == :src
+        css_class = " class=\"src\"" if mode == :src and @block_lang.empty?
+        css_class = " class=\"src src-#{@block_lang}\"" if mode == :src and not @block_lang.empty?
         css_class = " class=\"example\"" if (mode == :example || mode == :inline_example)
         css_class = " style=\"text-align: center\"" if mode == :center
-        @logger.debug "#{mode}: <#{ModeTag[mode]}#{css_class}>\n" 
-        @output << "<#{ModeTag[mode]}#{css_class}>\n" unless mode == :table and skip_tables?
-        # Special case to add code tags to src blogs and specify language
-        if mode == :src
-          @logger.debug "<code class=\"#{@block_lang}\">\n"
-          @output << "<code class=\"#{@block_lang}\">\n"
+        unless ((mode == :table and skip_tables?) or
+                (mode == :src and defined? Pygments))
+          @logger.debug "#{mode}: <#{ModeTag[mode]}#{css_class}>\n"
+          @output << "<#{ModeTag[mode]}#{css_class}>\n"
         end
         # Entering a new mode obliterates the title decoration
         @title_decoration = ""
@@ -87,12 +86,11 @@ module Orgmode
       m = super(mode)
       if ModeTag[m] then
         output_indentation
-        if mode == :src
-          @logger.debug "</code>\n"
-          @output << "</code>\n"
+        unless ((mode == :table and skip_tables?) or
+                (mode == :src and defined? Pygments))
+          @logger.debug "</#{ModeTag[m]}>\n"
+          @output << "</#{ModeTag[m]}>\n"
         end
-        @logger.debug "</#{ModeTag[m]}>\n"
-        @output << "</#{ModeTag[m]}>\n" unless mode == :table and skip_tables?
       end
     end
 
@@ -103,16 +101,17 @@ module Orgmode
         # but we still have to catch the cases when a lexer for the language was not available
         if not @block_lang.empty? and (defined? CodeRay or defined? Pygments)
           # NOTE: CodeRay and Pygments already escape the html once, so no need to escape_buffer!
-          if defined? CodeRay
-            # CodeRay might throw a warning when unsupported lang is set
-            silence_warnings do
-              @buffer = CodeRay.scan(@buffer, @block_lang.to_s).html(:wrap => nil, :css => :style)
-            end
-          elsif defined? Pygments
+          if defined? Pygments
             begin
               @buffer = Pygments.highlight(@buffer, :lexer => @block_lang)
             rescue ::RubyPython::PythonError
-              # Not supported lexer from Pygments
+              # Not supported lexer from Pygments, we fallback on using the text lexer
+              @buffer = Pygments.highlight(@buffer, :lexer => 'text')
+            end
+          elsif defined? CodeRay
+            # CodeRay might throw a warning when unsupported lang is set
+            silence_warnings do
+              @buffer = CodeRay.scan(@buffer, @block_lang).html(:wrap => nil, :css => :style)
             end
           end
         else
diff --git a/spec/html_code_syntax_highlight_examples/advanced-code-coderay.html b/spec/html_code_syntax_highlight_examples/advanced-code-coderay.html
index 2eb253c..909dfea 100644
--- a/spec/html_code_syntax_highlight_examples/advanced-code-coderay.html
+++ b/spec/html_code_syntax_highlight_examples/advanced-code-coderay.html
@@ -16,8 +16,7 @@
 <p>Two ASCII blobs.</p>
 <h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC</h1>
 <p>And this:</p>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
     <span style="color:#777"># Finds all emphasis matches in a string.</span>
     <span style="color:#777"># Supply a block that will get the marker and body as parameters.</span>
     <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">match_all</span>(str)
@@ -25,11 +24,9 @@
         <span style="color:#080;font-weight:bold">yield</span> <span style="color:#d70">$2</span>, <span style="color:#d70">$3</span>
       <span style="color:#080;font-weight:bold">end</span>
     <span style="color:#080;font-weight:bold">end</span>
-</code>
 </pre>
 <p>Now let’s test case-insensitive code blocks.</p>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
     <span style="color:#777"># Finds all emphasis matches in a string.</span>
     <span style="color:#777"># Supply a block that will get the marker and body as parameters.</span>
     <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">match_all</span>(str)
@@ -37,10 +34,8 @@
         <span style="color:#080;font-weight:bold">yield</span> <span style="color:#d70">$2</span>, <span style="color:#d70">$3</span>
       <span style="color:#080;font-weight:bold">end</span>
     <span style="color:#080;font-weight:bold">end</span>
-</code>
 </pre>
-<pre class="src">
-<code class="clojure">
+<pre class="src src-clojure">
 (<span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">fib-seq</span>
   (<span style="color:#080;font-weight:bold">concat</span>
    [<span style="color:#00D">0</span> <span style="color:#00D">1</span>]
@@ -49,57 +44,45 @@
  
 user> (<span style="color:#080;font-weight:bold">take</span> <span style="color:#00D">20</span> fib-seq)
 (<span style="color:#00D">0</span> <span style="color:#00D">1</span> <span style="color:#00D">1</span> <span style="color:#00D">2</span> <span style="color:#00D">3</span> <span style="color:#00D">5</span> <span style="color:#00D">8</span> <span style="color:#00D">13</span> <span style="color:#00D">21</span> <span style="color:#00D">34</span> <span style="color:#00D">55</span> <span style="color:#00D">89</span> <span style="color:#00D">144</span> <span style="color:#00D">233</span> <span  [...]
-</code>
 </pre>
 <p>Even if no language is set, it is still wrapped in code tags but class is empty.</p>
 <pre class="src">
-<code class="">
 echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers
-</code>
 </pre>
 <h1><span class="heading-number heading-number-1">3 </span>It should be possible to write a colon at the beginning of an example</h1>
 <blockquote>
   <p>I really love to write about :symbols. They sure are the best things in the world!</p>
 </blockquote>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
 {
 <span style="color:#A60">:one</span> => <span style="color:#00D">1</span>,
 <span style="color:#A60">:two</span> => <span style="color:#00D">2</span>
 }
-</code>
 </pre>
-<pre class="src">
-<code class="clojure">
+<pre class="src src-clojure">
 (defproject helloworld <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">0.1</span><span style="color:#710">"</span></span>
 <span style="color:#A60">:dependencies</span> [[org.clojure/clojure
                  <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">1.1.0-master-SNAPSHOT</span><span style="color:#710">"</span></span>]
               [org.clojure/clojure-contrib
                  <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">1.0-SNAPSHOT</span><span style="color:#710">"</span></span>]]
 <span style="color:#A60">:main</span> helloworld)
-</code>
 </pre>
 <h1><span class="heading-number heading-number-1">4 </span>Code syntax highlight with Coderay</h1>
 <h2><span class="heading-number heading-number-2">4.1 </span>No language selected</h2>
 <pre class="src">
-<code class="">
 Nothing to see here
-</code>
 </pre>
 <h2><span class="heading-number heading-number-2">4.2 </span>CSS example</h2>
-<pre class="src">
-<code class="css">
+<pre class="src src-css">
  <span style="color:#339;font-weight:bold">*</span> {
   <span style="color:#777">/* apply a natural box layout model to all elements */</span>
   <span style="color:#606">box-sizing</span>: <span style="color:#088">border-box</span>; 
   <span style="color:#606">-moz-box-sizing</span>: <span style="color:#088">border-box</span>; 
   <span style="color:#606">-webkit-box-sizing</span>: <span style="color:#088">border-box</span>; 
  }
-</code>
 </pre>
 <h2><span class="heading-number heading-number-2">4.3 </span>HTML example</h2>
-<pre class="src">
-<code class="html">
+<pre class="src src-html">
 <span style="color:#070"><html></span>
   <span style="color:#070"><head></span>
     <span style="color:#070"><title></span>Hello<span style="color:#070"></title></span>
@@ -108,30 +91,24 @@ Nothing to see here
     <span style="color:#070"><h1></span>Hello<span style="color:#070"></h1></span>
   <span style="color:#070"></body></span>
 <span style="color:#070"></html></span>
-</code>
 </pre>
 <h2><span class="heading-number heading-number-2">4.4 </span>Ruby example</h2>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
 <span style="color:#080;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Post</span> << <span style="color:#036;font-weight:bold">ActiveRecord</span>::<span style="color:#036;font-weight:bold">Base</span>
   <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">print_title</span>
     puts <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="background-color:hsla(0,0%,0%,0.07);color:black"><span style="font-weight:bold;color:#666">#{</span><span style="color:#069">self</span>.title<span style="font-weight:bold;color:#666">}</span></span><span style="color:#710">"</span></span>
   <span style="color:#080;font-weight:bold">end</span>
 <span style="color:#080;font-weight:bold">end</span>
-</code>
 </pre>
 <h2><span class="heading-number heading-number-2">4.5 </span>Python example</h2>
-<pre class="src">
-<code class="python">
+<pre class="src src-python">
 <span style="color:#080;font-weight:bold">import</span> <span style="color:#B44;font-weight:bold">mapnik</span>
 
 m = mapnik.Map(<span style="color:#00D">600</span>, <span style="color:#00D">800</span>)
 m.background = Map.Color(<span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">'</span><span style="color:#D20">steelblue</span><span style="color:#710">'</span></span>)
-</code>
 </pre>
 <h2><span class="heading-number heading-number-2">4.6 </span>Javascript example</h2>
-<pre class="src">
-<code class="javascript">
+<pre class="src src-javascript">
 exports = <span style="color:#963">this</span>;
 
 (<span style="color:#080;font-weight:bold">function</span>(<span style="color:#369;font-weight:bold">$</span>){
@@ -143,35 +120,26 @@ Posts.<span style="color:#06B;font-weight:bold">index</span> = <span style="colo
 };
 
 })(jQuery);
-</code>
 </pre>
 <h2><span class="heading-number heading-number-2">4.7 </span>JSON example</h2>
-<pre class="src">
-<code class="json">
+<pre class="src src-json">
 { <span style="color:#F00;background-color:#FAA">n</span><span style="color:#F00;background-color:#FAA">a</span><span style="color:#F00;background-color:#FAA">m</span><span style="color:#F00;background-color:#FAA">e</span>: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Waldemar</span><span style="color:#710">"</span></span>
 , <span style="color:#F00;background-color:#FAA">s</span><span style="color:#F00;background-color:#FAA">u</span><span style="color:#F00;background-color:#FAA">r</span><span style="color:#F00;background-color:#FAA">n</span><span style="color:#F00;background-color:#FAA">a</span><span style="color:#F00;background-color:#FAA">m</span><span style="color:#F00;background-color:#FAA">e</span>: <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style= [...]
 }
-</code>
 </pre>
 <h2><span class="heading-number heading-number-2">4.8 </span>PHP example</h2>
-<pre class="src">
-<code class="php">
+<pre class="src src-php">
 <span style="color:#369;font-weight:bold">echo</span> <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">"</span><span style="color:#D20">Hello</span><span style="color:#710">"</span></span>;
 <span style="color:#369;font-weight:bold">phpinfo</span>();
 <span style="color:#369;font-weight:bold">var_dump</span>(some_var);
-</code>
 </pre>
 <h2><span class="heading-number heading-number-2">4.9 </span>Elisp example</h2>
-<pre class="src">
-<code class="scheme">
+<pre class="src src-scheme">
 (defun hello()
   (interactive)
   (message "hello"))
-</code>
 </pre>
 <h2><span class="heading-number heading-number-2">4.10 </span>Not supported language example</h2>
-<pre class="src">
-<code class="notsupported">
+<pre class="src src-notsupported">
 !+!+++!++!++!++!+
-</code>
 </pre>
diff --git a/spec/html_code_syntax_highlight_examples/advanced-code-no-color.html b/spec/html_code_syntax_highlight_examples/advanced-code-no-color.html
index d19933c..f52581c 100644
--- a/spec/html_code_syntax_highlight_examples/advanced-code-no-color.html
+++ b/spec/html_code_syntax_highlight_examples/advanced-code-no-color.html
@@ -16,8 +16,7 @@
 <p>Two ASCII blobs.</p>
 <h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC</h1>
 <p>And this:</p>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
     # Finds all emphasis matches in a string.
     # Supply a block that will get the marker and body as parameters.
     def match_all(str)
@@ -25,11 +24,9 @@
         yield $2, $3
       end
     end
-</code>
 </pre>
 <p>Now let’s test case-insensitive code blocks.</p>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
     # Finds all emphasis matches in a string.
     # Supply a block that will get the marker and body as parameters.
     def match_all(str)
@@ -37,10 +34,8 @@
         yield $2, $3
       end
     end
-</code>
 </pre>
-<pre class="src">
-<code class="clojure">
+<pre class="src src-clojure">
 (def fib-seq
   (concat
    [0 1]
@@ -49,33 +44,26 @@
  
 user> (take 20 fib-seq)
 (0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181)
-</code>
 </pre>
 <p>Even if no language is set, it is still wrapped in code tags but class is empty.</p>
 <pre class="src">
-<code class="">
 echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers
-</code>
 </pre>
 <h1><span class="heading-number heading-number-1">3 </span>It should be possible to write a colon at the beginning of an example</h1>
 <blockquote>
   <p>I really love to write about :symbols. They sure are the best things in the world!</p>
 </blockquote>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
 {
 :one => 1,
 :two => 2
 }
-</code>
 </pre>
-<pre class="src">
-<code class="clojure">
+<pre class="src src-clojure">
 (defproject helloworld "0.1"
 :dependencies [[org.clojure/clojure
                  "1.1.0-master-SNAPSHOT"]
               [org.clojure/clojure-contrib
                  "1.0-SNAPSHOT"]]
 :main helloworld)
-</code>
 </pre>
diff --git a/spec/html_code_syntax_highlight_examples/advanced-code-pygments.html b/spec/html_code_syntax_highlight_examples/advanced-code-pygments.html
index 30b5ca5..c2076fc 100644
--- a/spec/html_code_syntax_highlight_examples/advanced-code-pygments.html
+++ b/spec/html_code_syntax_highlight_examples/advanced-code-pygments.html
@@ -16,8 +16,6 @@
 <p>Two ASCII blobs.</p>
 <h1><span class="heading-number heading-number-1">2 </span>BEGIN_SRC</h1>
 <p>And this:</p>
-<pre class="src">
-<code class="ruby">
 <div class="highlight"><pre>    <span class="c1"># Finds all emphasis matches in a string.</span>
     <span class="c1"># Supply a block that will get the marker and body as parameters.</span>
     <span class="k">def</span> <span class="nf">match_all</span><span class="p">(</span><span class="n">str</span><span class="p">)</span>
@@ -27,11 +25,7 @@
     <span class="k">end</span>
 </pre>
 </div>
-</code>
-</pre>
 <p>Now let’s test case-insensitive code blocks.</p>
-<pre class="src">
-<code class="ruby">
 <div class="highlight"><pre>    <span class="c1"># Finds all emphasis matches in a string.</span>
     <span class="c1"># Supply a block that will get the marker and body as parameters.</span>
     <span class="k">def</span> <span class="nf">match_all</span><span class="p">(</span><span class="n">str</span><span class="p">)</span>
@@ -41,10 +35,6 @@
     <span class="k">end</span>
 </pre>
 </div>
-</code>
-</pre>
-<pre class="src">
-<code class="clojure">
 <div class="highlight"><pre><span class="p">(</span><span class="k">def </span><span class="nv">fib-seq</span>
   <span class="p">(</span><span class="nf">concat</span>
    <span class="p">[</span><span class="mi">0</span> <span class="mi">1</span><span class="p">]</span>
@@ -55,30 +45,18 @@
 <span class="p">(</span><span class="mi">0</span> <span class="mi">1</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span> <span class="mi">5</span> <span class="mi">8</span> <span class="mi">13</span> <span class="mi">21</span> <span class="mi">34</span> <span class="mi">55</span> <span class="mi">89</span> <span class="mi">144</span> <span class="mi">233</span> <span class="mi">377</span> <span class="mi">610</span> <span class="mi">987</span> <span class [...]
 </pre>
 </div>
-</code>
-</pre>
 <p>Even if no language is set, it is still wrapped in code tags but class is empty.</p>
-<pre class="src">
-<code class="">
-echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/sudoers
-</code>
-</pre>
+echo ‘Defaults env_keeps=”http_proxy https_proxy ftp_proxy”’ | sudo tee -a /etc/sudoers
 <h1><span class="heading-number heading-number-1">3 </span>It should be possible to write a colon at the beginning of an example</h1>
 <blockquote>
   <p>I really love to write about :symbols. They sure are the best things in the world!</p>
 </blockquote>
-<pre class="src">
-<code class="ruby">
 <div class="highlight"><pre><span class="p">{</span>
 <span class="ss">:one</span> <span class="o">=></span> <span class="mi">1</span><span class="p">,</span>
 <span class="ss">:two</span> <span class="o">=></span> <span class="mi">2</span>
 <span class="p">}</span>
 </pre>
 </div>
-</code>
-</pre>
-<pre class="src">
-<code class="clojure">
 <div class="highlight"><pre><span class="p">(</span><span class="kd">defproject </span><span class="nv">helloworld</span> <span class="s">"0.1"</span>
 <span class="ss">:dependencies</span> <span class="p">[[</span><span class="nv">org.clojure/clojure</span>
                  <span class="s">"1.1.0-master-SNAPSHOT"</span><span class="p">]</span>
@@ -87,18 +65,10 @@ echo 'Defaults env_keeps="http_proxy https_proxy ftp_proxy"' | sudo tee -a /etc/
 <span class="ss">:main</span> <span class="nv">helloworld</span><span class="p">)</span>
 </pre>
 </div>
-</code>
-</pre>
 <h1><span class="heading-number heading-number-1">4 </span>Code syntax highlight with Pygments</h1>
 <h2><span class="heading-number heading-number-2">4.1 </span>No language selected</h2>
-<pre class="src">
-<code class="">
 Nothing to see here
-</code>
-</pre>
 <h2><span class="heading-number heading-number-2">4.2 </span>CSS example</h2>
-<pre class="src">
-<code class="css">
 <div class="highlight"><pre> <span class="o">*</span> <span class="p">{</span>
   <span class="c">/* apply a natural box layout model to all elements */</span>
   <span class="n">box</span><span class="o">-</span><span class="n">sizing</span><span class="o">:</span> <span class="k">border</span><span class="o">-</span><span class="n">box</span><span class="p">;</span> 
@@ -107,11 +77,7 @@ Nothing to see here
  <span class="p">}</span>
 </pre>
 </div>
-</code>
-</pre>
 <h2><span class="heading-number heading-number-2">4.3 </span>HTML example</h2>
-<pre class="src">
-<code class="html">
 <div class="highlight"><pre><span class="nt"><html></span>
   <span class="nt"><head></span>
     <span class="nt"><title></span>Hello<span class="nt"></title></span>
@@ -122,11 +88,7 @@ Nothing to see here
 <span class="nt"></html></span>
 </pre>
 </div>
-</code>
-</pre>
 <h2><span class="heading-number heading-number-2">4.4 </span>Ruby example</h2>
-<pre class="src">
-<code class="ruby">
 <div class="highlight"><pre><span class="k">class</span> <span class="nc">Post</span> <span class="o"><<</span> <span class="no">ActiveRecord</span><span class="o">::</span><span class="no">Base</span>
   <span class="k">def</span> <span class="nf">print_title</span>
     <span class="nb">puts</span> <span class="s2">"</span><span class="si">#{</span><span class="nb">self</span><span class="o">.</span><span class="n">title</span><span class="si">}</span><span class="s2">"</span>
@@ -134,22 +96,14 @@ Nothing to see here
 <span class="k">end</span>
 </pre>
 </div>
-</code>
-</pre>
 <h2><span class="heading-number heading-number-2">4.5 </span>Python example</h2>
-<pre class="src">
-<code class="python">
 <div class="highlight"><pre><span class="kn">import</span> <span class="nn">mapnik</span>
 
 <span class="n">m</span> <span class="o">=</span> <span class="n">mapnik</span><span class="o">.</span><span class="n">Map</span><span class="p">(</span><span class="mi">600</span><span class="p">,</span> <span class="mi">800</span><span class="p">)</span>
 <span class="n">m</span><span class="o">.</span><span class="n">background</span> <span class="o">=</span> <span class="n">Map</span><span class="o">.</span><span class="n">Color</span><span class="p">(</span><span class="s">'steelblue'</span><span class="p">)</span>
 </pre>
 </div>
-</code>
-</pre>
 <h2><span class="heading-number heading-number-2">4.6 </span>Javascript example</h2>
-<pre class="src">
-<code class="javascript">
 <div class="highlight"><pre><span class="nx">exports</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
 
 <span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">$</span><span class="p">){</span>
@@ -163,41 +117,25 @@ Nothing to see here
 <span class="p">})(</span><span class="nx">jQuery</span><span class="p">);</span>
 </pre>
 </div>
-</code>
-</pre>
 <h2><span class="heading-number heading-number-2">4.7 </span>JSON example</h2>
-<pre class="src">
-<code class="json">
 <div class="highlight"><pre><span class="p">{</span> <span class="err">name:</span> <span class="nt">"Waldemar"</span>
 <span class="p">,</span> <span class="err">surname:</span> <span class="nt">"Quevedo"</span>
 <span class="p">}</span>
 </pre>
 </div>
-</code>
-</pre>
 <h2><span class="heading-number heading-number-2">4.8 </span>PHP example</h2>
-<pre class="src">
-<code class="php">
 <div class="highlight"><pre><span class="x">echo "Hello";</span>
 <span class="x">phpinfo();</span>
 <span class="x">var_dump(some_var);</span>
 </pre>
 </div>
-</code>
-</pre>
 <h2><span class="heading-number heading-number-2">4.9 </span>Elisp example</h2>
-<pre class="src">
-<code class="scheme">
 <div class="highlight"><pre><span class="p">(</span><span class="nf">defun</span> <span class="nv">hello</span><span class="p">()</span>
   <span class="p">(</span><span class="nf">interactive</span><span class="p">)</span>
   <span class="p">(</span><span class="nf">message</span> <span class="s">"hello"</span><span class="p">))</span>
 </pre>
 </div>
-</code>
-</pre>
 <h2><span class="heading-number heading-number-2">4.10 </span>Not supported language example</h2>
-<pre class="src">
-<code class="notsupported">
-!+!+++!++!++!++!+
-</code>
+<div class="highlight"><pre>!+!+++!++!++!++!+
 </pre>
+</div>
diff --git a/spec/html_code_syntax_highlight_examples/code-coderay.html b/spec/html_code_syntax_highlight_examples/code-coderay.html
index 3a0943e..609c6b0 100644
--- a/spec/html_code_syntax_highlight_examples/code-coderay.html
+++ b/spec/html_code_syntax_highlight_examples/code-coderay.html
@@ -1,6 +1,5 @@
 <h1 class="title">Simple Code Syntax highlighting test</h1>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
 <span style="color:#080;font-weight:bold">class</span> <span style="color:#B06;font-weight:bold">Coderay</span>
   <span style="color:#080;font-weight:bold">class</span> << <span style="color:#B06;font-weight:bold">self</span>
     <span style="color:#080;font-weight:bold">def</span> <span style="color:#06B;font-weight:bold">colorize</span>
@@ -11,5 +10,4 @@ EOF</span></span>
     <span style="color:#080;font-weight:bold">end</span>
   <span style="color:#080;font-weight:bold">end</span>
 <span style="color:#080;font-weight:bold">end</span>
-</code>
 </pre>
diff --git a/spec/html_code_syntax_highlight_examples/code-no-color.html b/spec/html_code_syntax_highlight_examples/code-no-color.html
index 9010bd1..c622b8d 100644
--- a/spec/html_code_syntax_highlight_examples/code-no-color.html
+++ b/spec/html_code_syntax_highlight_examples/code-no-color.html
@@ -1,6 +1,5 @@
 <h1 class="title">Simple Code Syntax highlighting test</h1>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
 class Pygments
   class << self
     def colorize
@@ -11,7 +10,6 @@ EOF
     end
   end
 end
-</code>
 </pre>
 <p>Now using EXAMPLE blocks instead:</p>
 <pre class="example">
@@ -27,12 +25,10 @@ class Hello
   end
 end
 </pre>
-<pre class="src">
-<code class="ruby">
+<pre class="src src-ruby">
 class Piano
   def play_note(note)
   # TODO
   end
 end
-</code>
 </pre>
diff --git a/spec/html_code_syntax_highlight_examples/code-pygments.html b/spec/html_code_syntax_highlight_examples/code-pygments.html
index 0a22120..c59d7cd 100644
--- a/spec/html_code_syntax_highlight_examples/code-pygments.html
+++ b/spec/html_code_syntax_highlight_examples/code-pygments.html
@@ -1,6 +1,4 @@
 <h1 class="title">Simple Code Syntax highlighting test</h1>
-<pre class="src">
-<code class="ruby">
 <div class="highlight"><pre><span class="k">class</span> <span class="nc">Pygments</span>
   <span class="k">class</span> <span class="o"><<</span> <span class="nb">self</span>
     <span class="k">def</span> <span class="nf">colorize</span>
@@ -13,8 +11,6 @@
 <span class="k">end</span>
 </pre>
 </div>
-</code>
-</pre>
 <p>Now using EXAMPLE blocks instead:</p>
 <pre class="example">
 def hello()
@@ -29,8 +25,6 @@ class Hello
   end
 end
 </pre>
-<pre class="src">
-<code class="ruby">
 <div class="highlight"><pre><span class="k">class</span> <span class="nc">Piano</span>
   <span class="k">def</span> <span class="nf">play_note</span><span class="p">(</span><span class="n">note</span><span class="p">)</span>
   <span class="c1"># TODO</span>
@@ -38,5 +32,3 @@ end
 <span class="k">end</span>
 </pre>
 </div>
-</code>
-</pre>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-org.git



More information about the Pkg-ruby-extras-commits mailing list