Permalink
Browse files

roff: add paragraph above blockquotes for spacing

  • Loading branch information...
1 parent d258d1b commit 09811b6371807c98bd30c9d78e654454bb312d0e @sunaku committed Oct 6, 2012
Showing with 28 additions and 5 deletions.
  1. +2 −2 lib/md2man/roff.rb
  2. +26 −3 test/md2man/roff_test.rb
View
@@ -42,11 +42,11 @@ def normal_paragraph text
end
def block_code code, language
- block_quote "\n.nf\n.PP\n#{code.chomp}\n.fi\n"
+ block_quote "\n.nf\n#{code.chomp}\n.fi\n"
end
def block_quote quote
- "\n.RS\n#{remove_leading_pp(quote).chomp}\n.RE\n"
+ "\n.PP\n.RS\n#{remove_leading_pp(quote).chomp}\n.RE\n"
end
def block_html html
View
@@ -268,6 +268,28 @@ def heredoc document
|> 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
@@ -282,9 +304,9 @@ def heredoc document
@markdown.render(heredoc(<<-INPUT)).must_equal(heredoc(<<-OUTPUT))
| single preformatted line
INPUT
+ |.PP
|.RS
|.nf
- |.PP
|single preformatted line
|.fi
|.RE
@@ -297,9 +319,9 @@ def heredoc document
| > lines
| with 4-space indent
INPUT
+ |.PP
|.RS
|.nf
- |.PP
|just some *paragraph*
| spanning
| **multiple**
@@ -316,9 +338,9 @@ def heredoc document
INPUT
|.PP
|normal paragraph line
+ |.PP
|.RS
|.nf
- |.PP
|single preformatted line
|.fi
|.RE
@@ -505,6 +527,7 @@ def heredoc document
|>
|>bar
INPUT
+ |.PP
|.RS
|foo
|.ti 0

0 comments on commit 09811b6

Please sign in to comment.