Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions lib/rdoc/markup/to_rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
# Outputs RDoc markup as RDoc markup! (mostly)

class RDoc::Markup::ToRdoc < RDoc::Markup::Formatter
DEFAULT_HEADINGS = {
1 => ['= ', ''],
2 => ['== ', ''],
3 => ['=== ', ''],
4 => ['==== ', ''],
5 => ['===== ', ''],
6 => ['====== ', '']
}
DEFAULT_HEADINGS.default = []
DEFAULT_HEADINGS.freeze

##
# Current indent amount for output in characters
Expand Down Expand Up @@ -49,16 +59,7 @@ def initialize markup = nil
@width = 78
init_tags

@headings = {}
@headings.default = []

@headings[1] = ['= ', '']
@headings[2] = ['== ', '']
@headings[3] = ['=== ', '']
@headings[4] = ['==== ', '']
@headings[5] = ['===== ', '']
@headings[6] = ['====== ', '']

@headings = DEFAULT_HEADINGS.dup
@hard_break = "\n"
end

Expand Down