summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup.rb
diff options
context:
space:
mode:
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