<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -21,6 +21,7 @@ module PDoc
           end
           
           def htmlize(markdown)
+            markdown = Website.syntax_highlighter.parse(markdown)
             Maruku.new(markdown).to_html
           end
           </diff>
      <filename>lib/pdoc/generators/html/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,13 @@
 module PDoc
   module Generators
     module Html
-      CODE_BLOCK_REGEXP = /(?:\n\n|\A)(?:\s{4,}lang(?:uage)?:\s*(\w+)\s*\n)?((?:\s{4}.*\n+)+)(^\s{0,3}\S|\Z)/
-      attr_reader :default_language, :highlighter
-      
       class SyntaxHighlighter
-        def initialize(options = {})
-          @default_language = options[:default_language] ||= :javascript
-          @highlighter      = options[:highlighter]      ||= :none
+        CODE_BLOCK_REGEXP = /(?:\n\n|\A)(?:\s{4,}lang(?:uage)?:\s*(\w+)\s*\n)?((?:\s{4}.*\n*)+)(^\s{0,3}\S|\z)?/
+        
+        attr_reader :highlighter
+        
+        def initialize(highlighter = :none)
+          @highlighter = highlighter
         end
         
         def parse(input)
@@ -18,7 +18,8 @@ module PDoc
           end
         end
         
-        def highlight_block(code, language = default_language)
+        def highlight_block(code, language)
+          language = :javascript if language.nil?
           case highlighter
             when :none
               &quot;&lt;pre&gt;&lt;code class=\&quot;#{language}\&quot;&gt;#{code}&lt;/code&gt;&lt;/pre&gt;&quot;</diff>
      <filename>lib/pdoc/generators/html/syntax_highlighter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,10 +10,15 @@ module PDoc
         
         include Helpers::BaseHelper
         
+        class &lt;&lt; Website
+          attr_accessor :syntax_highlighter
+        end
+        
         def initialize(parser_output, options = {})
           super
           @templates_directory = File.expand_path(options[:templates] || TEMPLATES_DIRECTORY)
           @index_page = options[:index_page] &amp;&amp; File.expand_path(options[:index_page])
+          Website.syntax_highlighter = SyntaxHighlighter.new(options[:syntax_highlighter])
           load_custom_helpers
         end
         </diff>
      <filename>lib/pdoc/generators/html/website.rb</filename>
    </modified>
    <modified>
      <diff>@@ -79,6 +79,19 @@ class HtmlHelpersTest &lt; Test::Unit::TestCase
     assert html.include?('$(element...)'), 'Missing vararg signature'
   end
   
+  def test_htmlize_syntax_highlight
+    PDoc::Generators::Html::Website.syntax_highlighter = PDoc::Generators::Html::SyntaxHighlighter.new
+    doc = parse_doc(&lt;&lt;-DOC)
+Element#foo() -&gt; Element
+
+Example:
+    
+    var foo = &quot;bar&quot;;
+DOC
+      html = run_helper(:htmlize, doc, doc.to_a.last.description)
+      assert_equal(&quot;&lt;p&gt;Example:&lt;/p&gt;\n&lt;pre&gt;&lt;code class='javascript'&gt;var foo = \&quot;bar\&quot;;&lt;/code&gt;&lt;/pre&gt;&quot;, html)
+    end
+  
   def parse_doc(source)
     src = %(
 /** section: dom
@@ -86,7 +99,7 @@ class HtmlHelpersTest &lt; Test::Unit::TestCase
  **/
 
 /**
-#{source.strip.map { |line| &quot; * #{line.lstrip}&quot; }}
+#{source.strip.map { |line| &quot; * #{line}&quot; }}
  **/
     )
   PDoc::Parser.new(src).parse</diff>
      <filename>test/unit/templates/html_helpers_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dfc3284f2e24aef5215c927a1f2bcb36759b3029</id>
    </parent>
  </parents>
  <author>
    <name>Samuel Lebeau</name>
    <email>samuel.lebeau@gmail.com</email>
  </author>
  <url>http://github.com/tobie/pdoc/commit/1f0160f08e10db19937624f0db05259e681597f9</url>
  <id>1f0160f08e10db19937624f0db05259e681597f9</id>
  <committed-date>2009-10-21T18:32:34-07:00</committed-date>
  <authored-date>2009-10-21T18:32:34-07:00</authored-date>
  <message>Integrate SyntaxHighlighter with CodeRay and Pygments support</message>
  <tree>fb6ccbbf178eea889f2146ed69a9c6ce2259804e</tree>
  <committer>
    <name>Samuel Lebeau</name>
    <email>samuel.lebeau@gmail.com</email>
  </committer>
</commit>
