Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

blockquote's leading paragraph regexp not anchored

  • Loading branch information...
commit 2a6f0b7c2fad2558cad51bf83ca4751f9368a1ef 1 parent 5d7df2e
@sunaku authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/md2man/roff.rb
View
8 lib/md2man/roff.rb
@@ -51,7 +51,7 @@ def block_code code, language
end
def block_quote quote
- "\n.RS\n#{quote.sub(/\n\.PP\n/, '').chomp}\n.RE\n"
+ "\n.RS\n#{remove_leading_pp(quote).chomp}\n.RE\n"
end
def block_html html
@@ -93,7 +93,7 @@ def list_item text, list_type
"\\(bu 2"
end
- ".IP #{designator}\n#{text.sub(/\A\n\.PP\n/, '').lstrip.chomp}\n"
+ ".IP #{designator}\n#{remove_leading_pp(text).lstrip.chomp}\n"
end
def table header, body
@@ -203,6 +203,10 @@ def entity text
private
+ def remove_leading_pp text
+ text.sub(/\A\n\.PP\n/, '')
+ end
+
TABLE_COL_DELIM = ' '
TABLE_ROW_DELIM = "\n"
TABLE_CELL_DELIM = "\t"
Please sign in to comment.
Something went wrong with that request. Please try again.