diff options
Diffstat (limited to 'lib/rdoc/markup')
-rw-r--r-- | lib/rdoc/markup/document.rb | 11 | ||||
-rw-r--r-- | lib/rdoc/markup/inline.rb | 9 | ||||
-rw-r--r-- | lib/rdoc/markup/to_ansi.rb | 6 |
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 ## |