mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Suppress format deprecation warnings
This commit is contained in:
parent
f5df74a37d
commit
0eeebd4e0c
3 changed files with 17 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
require 'temple'
|
||||
require 'hamlit/parser'
|
||||
require 'hamlit/compiler'
|
||||
require 'hamlit/html'
|
||||
require 'pretty_hamlit/engine'
|
||||
|
||||
module Hamlit
|
||||
|
@ -21,7 +22,7 @@ module Hamlit
|
|||
|
||||
use Parser
|
||||
use Compiler
|
||||
html :Fast
|
||||
use HTML
|
||||
filter :Escapable
|
||||
filter :ControlFlow
|
||||
filter :MultiFlattener
|
||||
|
|
13
lib/hamlit/html.rb
Normal file
13
lib/hamlit/html.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
module Hamlit
|
||||
class HTML < Temple::HTML::Fast
|
||||
DEPRECATED_FORMATS = %i[html4 html5].freeze
|
||||
|
||||
def initialize(opts = {})
|
||||
if DEPRECATED_FORMATS.include?(opts[:format])
|
||||
opts = opts.dup
|
||||
opts[:format] = :html
|
||||
end
|
||||
super(opts)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,5 +1,6 @@
|
|||
require 'temple'
|
||||
require 'hamlit/parser'
|
||||
require 'hamlit/html'
|
||||
require 'pretty_hamlit/compiler'
|
||||
require 'pretty_hamlit/dynamic_indentation'
|
||||
|
||||
|
@ -21,7 +22,7 @@ module PrettyHamlit
|
|||
|
||||
use Hamlit::Parser
|
||||
use Compiler
|
||||
html :Fast
|
||||
use Hamlit::HTML
|
||||
filter :Escapable
|
||||
filter :ControlFlow
|
||||
filter :MultiFlattener
|
||||
|
|
Loading…
Add table
Reference in a new issue