test/md2man/roff_test.rb in md2man-2.0.1 vs test/md2man/roff_test.rb in md2man-2.0.2

- old
+ new

@@ -140,10 +140,27 @@ | is another | normal | paragraph. OUTPUT end + + it 'escapes backslashes in normal text' do + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |c:\\drive + INPUT + |.PP + |c:\\[rs]drive + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |c:\\drive\\walk\\\\\\car + INPUT + |.PP + |c:\\[rs]drive\\[rs]walk\\[rs]\\[rs]car + OUTPUT + end + it 'escapes hyphens in normal text' do @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) |pre-process INPUT |.PP @@ -153,9 +170,69 @@ @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) |1-5 INPUT |.PP |1\\-5 + OUTPUT + end + + it 'inhibits periods at the beginning of lines in normal text' do + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |. + INPUT + |.PP + |\\&. + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |.. + INPUT + |.PP + |\\&.. + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |... + INPUT + |.PP + |\\&... + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |.hello. world qu.o.tes + INPUT + |.PP + |\\&.hello. world qu.o.tes + OUTPUT + end + + it 'inhibits single quotes at the beginning of lines in normal text' do + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |' + INPUT + |.PP + |\\&' + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |'' + INPUT + |.PP + |\\&'' + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |''' + INPUT + |.PP + |\\&''' + OUTPUT + + @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT)) + |'hello' world qu'o'tes + INPUT + |.PP + |\\&'hello' world qu'o'tes OUTPUT end it 'renders emphasis' do @markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))