aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/markup.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-28 02:28:25 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-28 02:28:25 +0000
commit84ece951630c61eddab8be47b80fc1a7f774175f (patch)
treec843f17ba485f0263f39d797d8a3b1517d1ddb8b /lib/rdoc/markup.rb
parent41ab31e67a747e5db91a7ef4502a54cdf0525163 (diff)
downloadruby-84ece951630c61eddab8be47b80fc1a7f774175f.tar.gz
* lib/rdoc: Update to RDoc 3.7 (final)
* NEWS: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/markup.rb')
-rw-r--r--lib/rdoc/markup.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/rdoc/markup.rb b/lib/rdoc/markup.rb
index bc28522615..6122fcac65 100644
--- a/lib/rdoc/markup.rb
+++ b/lib/rdoc/markup.rb
@@ -616,11 +616,16 @@ class RDoc::Markup
end
##
- # We take +text+, parse it then invoke the output +formatter+ using a
- # Visitor to render the result.
+ # We take +input+, parse it if necessary, then invoke the output +formatter+
+ # using a Visitor to render the result.
- def convert text, formatter
- document = RDoc::Markup::Parser.parse text
+ def convert input, formatter
+ document = case input
+ when RDoc::Markup::Document then
+ input
+ else
+ RDoc::Markup::Parser.parse input
+ end
document.accept formatter
end