github/markup — Issue #89: rdoc relative link:'s are misrendered
Author: mncharity
Created: 2011-11-02 06:52:52+00:00
State: open

If an rdoc file a/b/C.rdoc, contains a correct link [link:a/b/D], github misrenders it as a/b/a/b/D. Note the extra "a/b/". So such links are 404.

RDoc link: paths are relative to the output root, not to the file being rendered.

"Links starting with link: refer to local files whose path is relative to the --op directory." [1]
RDoc::Markup::ToHtml provides "from_path Path to this document for relative links" [2]
When rendering a file, GitHub::Markup isn't passing the file's name to renderers [3], so GitHub::Markup::RDoc can't set from_path [4], which defaults to "". So the link url isn't getting trimmed.

[1] http://docs.seattlerb.org/rdoc/RDoc/Markup.html
[2] http://docs.seattlerb.org/rdoc/RDoc/Markup/ToHtml.html https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markup/to_html.rb
[3] https://github.com/github/markup/blob/master/lib/github/markup.rb
[4] https://github.com/github/markup/blob/master/lib/github/markup/rdoc.rb