Make :escape_attrs accessible from the command line.

This commit is contained in:
Nathan Weizenbaum 2010-10-29 01:18:49 -07:00
parent 863c64c740
commit 5b59ede6db
2 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,7 @@
that allows attributes to either remain unescaped
(for things like embedding PHP directives in Haml)
or to be always escaped rather than `#escape_once`d.
This can also be used from the command line via `--no-escape-attrs`.
### Backwards Incompatibilities -- Must Read!

View File

@ -212,6 +212,11 @@ END
@options[:for_engine][:escape_html] = true
end
opts.on('--no-escape-attrs',
"Don't escape HTML characters (like ampersands and angle brackets) in attributes.") do
@options[:for_engine][:escape_attrs] = false
end
opts.on('-q', '--double-quote-attributes',
'Set attribute wrapper to double-quotes (default is single).') do
@options[:for_engine][:attr_wrapper] = '"'