Skip to content

Commit

Permalink
Preserve square brackets in option listings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Gunderloy authored and Mike Gunderloy committed Feb 27, 2012
1 parent 00bd070 commit 97889ad
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 99 deletions.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ task :command_guide do
# This will end up in a <pre> block
html_string += line
else
puts html_string
html_string += line.gsub("<", "&lt;").gsub(">", "&gt;")
puts html_string
end
html_string += "\n"
end
Expand All @@ -72,7 +74,8 @@ task :command_guide do
break if (helpline =~ /Arguments/) || (helpline =~ /Summary/)
unless helpline.gsub(/\n/, '').strip == ''
# Use zero-width space to prevent "helpful" change of -- to &ndash;
helpline = helpline.gsub('--', '-&#8203;-')
helpline = helpline.gsub('--', '-&#8203;-').gsub('[', '\\[').gsub(']', '\\]')

if helpline =~ /^\s{10,}(.*)/
options = options[0..-2] + " #{$1}\n"
else
Expand Down
Loading

0 comments on commit 97889ad

Please sign in to comment.