lib/md2man/roff.rb in md2man-1.6.2 vs lib/md2man/roff.rb in md2man-2.0.0
- old
+ new
@@ -1,11 +1,10 @@
require 'md2man/document'
-module Md2Man
-module Roff
+module Md2Man::Roff
- include Document
+ include Md2Man::Document
#---------------------------------------------------------------------------
# document-level processing
#---------------------------------------------------------------------------
@@ -41,11 +40,11 @@
def normal_paragraph text
"\n.PP\n#{text}\n"
end
def block_code code, language
- code = escape_backslashes(super)
+ code = escape_backslashes(code)
block_quote "\n.nf\n#{code.chomp}\n.fi\n"
end
def block_quote quote
"\n.PP\n.RS\n#{remove_leading_pp(quote).chomp}\n.RE\n"
@@ -131,12 +130,12 @@
#---------------------------------------------------------------------------
# span-level processing
#---------------------------------------------------------------------------
- def reference page, section, addendum
- "\n.BR #{page} (#{section})#{addendum}\n"
+ def reference input_match, output_match
+ "\n.BR #{input_match[:page]} (#{input_match[:section]})#{output_match[:addendum]}\n"
end
def linebreak
"\n.br\n"
end
@@ -160,11 +159,11 @@
def superscript text
warn "md2man/roff: superscript not implemented: #{text.inspect}"
end
def codespan code
- code = escape_backslashes(super)
+ code = escape_backslashes(code)
# NOTE: this double font sequence gives us the best of both worlds:
# man(1) shows it in bold and `groff -Thtml` shows it in monospace
"\\fB\\fC#{code}\\fR"
end
@@ -861,7 +860,6 @@
0x2713 => "\\[OK]",
0x27e8 => "\\[la]",
0x27e9 => "\\[ra]",
}
-end
end