all repos — markup @ f65c5fdad47612d4218b6e37dbfe579179cd048a

The code we use to render README.your_favorite_markup

Support relative links in rdoc
tekkub tekkub@gmail.com
Tue, 20 Jul 2010 16:40:01 -0600
commit

f65c5fdad47612d4218b6e37dbfe579179cd048a

parent

43afedb678f525d2980f9591a399a16eaa8435fe

3 files changed, 13 insertions(+), 1 deletions(-)

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

@@ -10,7 +10,7 @@ end

def to_html simple_markup = SM::SimpleMarkup.new - generator = Generators::HyperlinkHtml.new(nil, OpenStruct.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)
M test/markups/README.rdoctest/markups/README.rdoc

@@ -1,2 +1,6 @@

* One * Two + +This is an {absolute link}[http://github.com]. So is this: http://github.com + +This is a {relative link}[link:rawr.html]. So is this: link:rawr.html
M test/markups/README.rdoc.htmltest/markups/README.rdoc.html

@@ -6,3 +6,11 @@ <li>Two

</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>