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:
parent
863c64c740
commit
5b59ede6db
2 changed files with 6 additions and 0 deletions
|
@ -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!
|
||||
|
||||
|
|
|
@ -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] = '"'
|
||||
|
|
Loading…
Add table
Reference in a new issue