test/md2man/roff_test.rb in md2man-1.3.0 vs test/md2man/roff_test.rb in md2man-1.3.1
- old
+ new
@@ -67,17 +67,27 @@
|just some paragraph
| spanning
| multiple
| lines
| but within 4-space indent
+ |
+ | and a single line following
+ |
+ | and multiple
+ | lines following
INPUT
|.TP
|just some paragraph
|spanning
|multiple
|lines
|but within 4\\-space indent
+ |.IP
+ |and a single line following
+ |.IP
+ |and multiple
+ |lines following
OUTPUT
end
it 'renders indented paragraphs that are uniformly two-space indented' do
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
@@ -256,44 +266,87 @@
|> spanning
|> multiple
|> lines
|>but within 4-space indent
INPUT
+ |.PP
|.RS
|just some paragraph
|spanning
| multiple
| lines
|but within 4\\-space indent
|.RE
OUTPUT
+
+ @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
+ |some paragraph above
+ |
+ |>just some paragraph
+ |> spanning
+ |> multiple
+ |> lines
+ |>but within 4-space indent
+ INPUT
+ |.PP
+ |some paragraph above
+ |.PP
+ |.RS
+ |just some paragraph
+ |spanning
+ | multiple
+ | lines
+ |but within 4\\-space indent
+ |.RE
+ OUTPUT
end
it 'renders code blocks' do
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
| single preformatted line
INPUT
+ |.PP
+ |.RS
|.nf
|single preformatted line
|.fi
+ |.RE
OUTPUT
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
| just some *paragraph*
| spanning
| **multiple**
| > lines
| with 4-space indent
INPUT
+ |.PP
+ |.RS
|.nf
|just some *paragraph*
| spanning
| **multiple**
|> lines
|with 4-space indent
|.fi
+ |.RE
OUTPUT
+
+ @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
+ |normal paragraph line
+ |
+ | single preformatted line
+ INPUT
+ |.PP
+ |normal paragraph line
+ |.PP
+ |.RS
+ |.nf
+ |single preformatted line
+ |.fi
+ |.RE
+ OUTPUT
end
it 'renders code spans' do
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
|here is `some code` for you
@@ -472,10 +525,11 @@
|>
|>* * *
|>
|>bar
INPUT
+ |.PP
|.RS
|foo
|.ti 0
|\\l'\\n(.lu'
|.PP
@@ -577,8 +631,59 @@
|convert them from#{SPACE}
|.BR markdown (7)#{SPACE}
|into#{SPACE}
|.BR roff (7),#{SPACE}
|using
+ OUTPUT
+ end
+
+ it 'does not render references inside code blocks' do
+ @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
+ | this is a code block
+ | containing markdown(7),
+ | roff(7), and much more!
+ INPUT
+ |.PP
+ |.RS
+ |.nf
+ |this is a code block
+ |containing markdown(7),
+ |roff(7), and much more!
+ |.fi
+ |.RE
+ OUTPUT
+ end
+
+ it 'does not render references inside code spans' do
+ @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
+ |this is a code span `containing markdown(7), roff(7), and` much more!
+ INPUT
+ |.PP
+ |this is a code span \\fB\\fCcontaining markdown(7), roff(7), and\\fR much more!
+ OUTPUT
+ end
+
+ it 'renders references to manual pages present on my linux box' do
+ @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
+ |man(1)
+ |man-pages(7)
+ |ld.so(8)
+ |ld-linux.so(8)
+ |ld-linux(8)
+ |aio.h(0p)
+ |vi(1p)
+ |vfork(3p)
+ |exit(3tcl)
+ INPUT
+ |.PP
+ |.BR man (1)
+ |.BR man-pages (7)
+ |.BR ld.so (8)
+ |.BR ld-linux.so (8)
+ |.BR ld-linux (8)
+ |.BR aio.h (0p)
+ |.BR vi (1p)
+ |.BR vfork (3p)
+ |.BR exit (3tcl)
OUTPUT
end
end