summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup
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
parent41ab31e67a747e5db91a7ef4502a54cdf0525163 (diff)
* 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')
-rw-r--r--lib/rdoc/markup/document.rb11
-rw-r--r--lib/rdoc/markup/inline.rb9
-rw-r--r--lib/rdoc/markup/to_ansi.rb6
3 files changed, 20 insertions, 6 deletions
diff --git a/lib/rdoc/markup/document.rb b/lib/rdoc/markup/document.rb
index b4e070285e..6fbef33ae3 100644
--- a/lib/rdoc/markup/document.rb
+++ b/lib/rdoc/markup/document.rb
@@ -56,7 +56,12 @@ class RDoc::Markup::Document
visitor.start_accepting
@parts.each do |item|
- item.accept visitor
+ case item
+ when RDoc::Markup::Document then # HACK
+ visitor.accept_document item
+ else
+ item.accept visitor
+ end
end
visitor.end_accepting
@@ -66,7 +71,9 @@ class RDoc::Markup::Document
# Does this document have no parts?
def empty?
- @parts.empty?
+ @parts.empty? or
+ (@parts.length == 1 and RDoc::Markup::Document === @parts.first and
+ @parts.first.empty?)
end
##
diff --git a/lib/rdoc/markup/inline.rb b/lib/rdoc/markup/inline.rb
index 932ed536b7..cf598d1583 100644
--- a/lib/rdoc/markup/inline.rb
+++ b/lib/rdoc/markup/inline.rb
@@ -60,7 +60,14 @@ class RDoc::Markup
class AttrChanger
def to_s # :nodoc:
- "Attr: +#{Attribute.as_string turn_on}/-#{Attribute.as_string turn_on}"
+ "Attr: +#{Attribute.as_string turn_on}/-#{Attribute.as_string turn_off}"
+ end
+
+ def inspect # :nodoc:
+ "+%s/-%s" % [
+ Attribute.as_string(turn_on),
+ Attribute.as_string(turn_off),
+ ]
end
end
diff --git a/lib/rdoc/markup/to_ansi.rb b/lib/rdoc/markup/to_ansi.rb
index 108a038075..1e8a0289d9 100644
--- a/lib/rdoc/markup/to_ansi.rb
+++ b/lib/rdoc/markup/to_ansi.rb
@@ -12,9 +12,9 @@ class RDoc::Markup::ToAnsi < RDoc::Markup::ToRdoc
super
@headings.clear
- @headings[1] = ["\e[1;32m", "\e[m"]
- @headings[2] = ["\e[4;32m", "\e[m"]
- @headings[3] = ["\e[32m", "\e[m"]
+ @headings[1] = ["\e[1;32m", "\e[m"] # bold
+ @headings[2] = ["\e[4;32m", "\e[m"] # underline
+ @headings[3] = ["\e[32m", "\e[m"] # just green
end
##