Support relative links in rdoc
tekkub tekkub@gmail.com
Tue, 20 Jul 2010 16:40:01 -0600
3 files changed,
13 insertions(+),
1 deletions(-)
M
lib/github/markup/rdoc.rb
→
lib/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.rdoc
→
test/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.html
→
test/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>