diff options
Diffstat (limited to 'lib/rdoc/markup/to_ansi.rb')
-rw-r--r-- | lib/rdoc/markup/to_ansi.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/rdoc/markup/to_ansi.rb b/lib/rdoc/markup/to_ansi.rb index 1e8a0289d9..4d439ce88d 100644 --- a/lib/rdoc/markup/to_ansi.rb +++ b/lib/rdoc/markup/to_ansi.rb @@ -1,5 +1,3 @@ -require 'rdoc/markup/to_rdoc' - ## # Outputs RDoc markup with vibrant ANSI color! @@ -34,6 +32,11 @@ class RDoc::Markup::ToAnsi < RDoc::Markup::ToRdoc when :BULLET then 2 when :NOTE, :LABEL then + if @prefix then + @res << @prefix.strip + @prefix = nil + end + @res << "\n" unless res.length == 1 2 else @@ -53,7 +56,13 @@ class RDoc::Markup::ToAnsi < RDoc::Markup::ToRdoc when :BULLET then '*' when :NOTE, :LABEL then - attributes(list_item.label) + ":\n" + labels = Array(list_item.label).map do |label| + attributes(label).strip + end.join "\n" + + labels << ":\n" unless labels.empty? + + labels else @list_index.last.to_s + '.' end |