test/md2man/roff_test.rb in md2man-2.0.3 vs test/md2man/roff_test.rb in md2man-2.0.4

- old
+ new

@@ -173,11 +173,11 @@ |.PP |1\\-5 OUTPUT end - it 'inhibits periods at the beginning of lines in normal text' do + it 'escapes periods at the beginning of lines in normal text' do @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) |. INPUT |.PP |\\&. @@ -203,11 +203,11 @@ |.PP |\\&.hello. world qu.o.tes OUTPUT end - it 'inhibits single quotes at the beginning of lines in normal text' do + it 'escapes single quotes at the beginning of lines in normal text' do @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) |' INPUT |.PP |\\&' @@ -233,10 +233,102 @@ |.PP |\\&'hello' world qu'o'tes OUTPUT end + it 'escapes periods at the beginning of lines in code blocks' do + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + | . + INPUT + |.PP + |.RS + |.nf + |\\&. + |.fi + |.RE + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + | .. + INPUT + |.PP + |.RS + |.nf + |\\&.. + |.fi + |.RE + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + | ... + INPUT + |.PP + |.RS + |.nf + |\\&... + |.fi + |.RE + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + | .hello. world qu.o.tes + INPUT + |.PP + |.RS + |.nf + |\\&.hello. world qu.o.tes + |.fi + |.RE + OUTPUT + end + + it 'escapes single quotes at the beginning of lines in code blocks' do + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + | ' + INPUT + |.PP + |.RS + |.nf + |\\&' + |.fi + |.RE + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + | '' + INPUT + |.PP + |.RS + |.nf + |\\&'' + |.fi + |.RE + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + | ''' + INPUT + |.PP + |.RS + |.nf + |\\&''' + |.fi + |.RE + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + | 'hello' world qu'o'tes + INPUT + |.PP + |.RS + |.nf + |\\&'hello' world qu'o'tes + |.fi + |.RE + OUTPUT + end + it 'renders emphasis' do @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) |just *some paragraph* | sp*ann*ing | multiple @@ -421,11 +513,11 @@ |.nf |just some *paragraph* | spanning | **multiple** |> lines - |with 4-space indent + |with 4\\-space indent |.fi |.RE OUTPUT @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) @@ -461,11 +553,11 @@ |_______ _______ | ___ /___________ /__ | _ __/ __ \\\\ __/ /_/ | / /_/ /_/ / / / ,\\\\ | \\\\__/\\\\____/_/ /_/|_\\\\ - | >>>------> + | >>>\\-\\-\\-\\-\\-\\-> |.fi |.RE OUTPUT end @@ -767,10 +859,10 @@ |.BR printf (3)\\fR#{SPACE} |cross reference would be emitted as this HTML: |.PP |.RS |.nf - |<a class="md2man-xref" href="../man3/printf.3.html"> + |<a class="md2man\\-xref" href="../man3/printf.3.html"> |.BR printf (3)</a> |.fi |.RE OUTPUT end