all repos — markup @ ae7c13758d1750db5b5ec966129bfcfdd8dc053f

The code we use to render README.your_favorite_markup

upgrade to rdoc 3.6.1
Simon Rozet simon@rozet.name
Mon, 27 Jun 2011 20:36:37 +0200
commit

ae7c13758d1750db5b5ec966129bfcfdd8dc053f

parent

4b9db44916855b99ae0987993f2f90cdaada884e

2 files changed, 12 insertions(+), 21 deletions(-)

jump to
M lib/github/markup/rdoc.rblib/github/markup/rdoc.rb

@@ -1,5 +1,4 @@

-require 'rdoc/generators/html_generator' -require 'ostruct' +require "rdoc/markup/to_html" module GitHub module Markup

@@ -9,11 +8,8 @@ @content = content

end def to_html - simple_markup = SM::SimpleMarkup.new - generator = Generators::HyperlinkHtml.new('', OpenStruct.new) - simple_markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK) - simple_markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK) - simple_markup.convert(@content, generator) + h = ::RDoc::Markup::ToHtml.new + h.convert(@content) end end end
M test/markups/README.rdoc.htmltest/markups/README.rdoc.html

@@ -1,16 +1,11 @@

-<ul> -<li>One +<ul><li> +<p>One</p> +</li><li> +<p>Two</p> +</li></ul> -</li> -<li>Two +<p>This is an <a href="http://github.com">absolute link</a>. So is this: <a +href="http://github.com">github.com</a></p> -</li> -</ul> -<p> -This is an <a href="http://github.com">absolute link</a>. So is this: <a -href="http://github.com">github.com</a> -</p> -<p> -This is a <a href="rawr.html">relative link</a>. So is this: <a -href="rawr.html">rawr.html</a> -</p> +<p>This is a <a href="rawr.html">relative link</a>. So is this: <a +href="rawr.html">rawr.html</a></p>