1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

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 that allows attributes to either remain unescaped
(for things like embedding PHP directives in Haml) (for things like embedding PHP directives in Haml)
or to be always escaped rather than `#escape_once`d. 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! ### Backwards Incompatibilities -- Must Read!

View file

@ -212,6 +212,11 @@ END
@options[:for_engine][:escape_html] = true @options[:for_engine][:escape_html] = true
end 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', opts.on('-q', '--double-quote-attributes',
'Set attribute wrapper to double-quotes (default is single).') do 'Set attribute wrapper to double-quotes (default is single).') do
@options[:for_engine][:attr_wrapper] = '"' @options[:for_engine][:attr_wrapper] = '"'