Skip to content

Commit

Permalink
drop redundant nil check in normal_text => escape
Browse files Browse the repository at this point in the history
  • Loading branch information
sunaku committed Jun 21, 2014
1 parent 879a693 commit 76b4a28
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/md2man/roff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,17 @@ def entity text
private

def escape text, literally
if text then text.
# escape backslashes so that they appear in the printable output
gsub('\\', literally ? '\&\&' : '\\[rs]').
text.

# escape soft-hyphens so that they appear in the printable output
gsub('-', '\\-').
# escape backslashes so that they appear in the printable output
gsub('\\', literally ? '\&\&' : '\\[rs]').

# escape line-beginning control characters (period and single quote)
# by prefixing a non-printable, zero-width glyph (backslash ampersand)
gsub(/^(?=[.'])/, '\\\\&')
end
# escape soft-hyphens so that they appear in the printable output
gsub('-', '\\-').

# escape line-beginning control characters (period and single quote)
# by prefixing a non-printable, zero-width glyph (backslash ampersand)
gsub(/^(?=[.'])/, '\\\\&')
end

def remove_leading_pp text
Expand Down

0 comments on commit 76b4a28

Please sign in to comment.