hamlit 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -11
- data/Rakefile +3 -10
- data/benchmarks/benchmark.rb +1 -2
- data/lib/hamlit/compiler.rb +0 -2
- data/lib/hamlit/compilers/attributes.rb +1 -4
- data/lib/hamlit/compilers/script.rb +1 -10
- data/lib/hamlit/engine.rb +5 -15
- data/lib/hamlit/html.rb +10 -0
- data/lib/hamlit/parser.rb +2 -4
- data/lib/hamlit/parsers/script.rb +3 -17
- data/lib/hamlit/railtie.rb +0 -2
- data/lib/hamlit/version.rb +1 -1
- data/spec/Rakefile +15 -14
- data/spec/hamlit/engine/script_spec.rb +12 -3
- data/spec/hamlit/engine/silent_script_spec.rb +1 -1
- data/spec/hamlit/engine_spec.rb +0 -1
- data/spec/hamlit/{ugly_spec.rb → haml_spec.rb} +108 -102
- data/spec/spec_helper.rb +0 -5
- metadata +4 -11
- data/lib/hamlit/compilers/preserve.rb +0 -10
- data/lib/hamlit/concerns/escapable.rb +0 -17
- data/lib/hamlit/html/pretty.rb +0 -49
- data/lib/hamlit/html/ugly.rb +0 -10
- data/spec/hamlit/compilers/script_spec.rb +0 -46
- data/spec/hamlit/engine/preservation_spec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3179fc842accfe9d500d85b4ab45abccd47cb1eb
|
4
|
+
data.tar.gz: 38eb7023728651efbd6d741b8d3de821e5dfc782
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74173d10d57f2419290f473b9b8a419a5f1cee0e371008bcbc1a7c18862796f7ecd18d0ce0bff63c2b44cf63f7f2e8c3be3e7c63919a97cfd061474a20ad0788
|
7
|
+
data.tar.gz: adfacd5b5d7625d66741e9fee4fa5ce3206a490cd91915406ebc758f47c53fe6732ef8bca5e23ca5a74846da9272565067351dba85f9c7d10a64de398c3ef3a5
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -50,18 +50,9 @@ Hamlit is used on [githubranking.com](http://githubranking.com/).
|
|
50
50
|
Basically the same as [haml](https://github.com/haml/haml).
|
51
51
|
Check out the [reference documentation](http://haml.info/docs/yardoc/file.REFERENCE.html) for details.
|
52
52
|
|
53
|
-
### Rails
|
53
|
+
### Rails, Sinatra
|
54
54
|
|
55
|
-
Just update Gemfile.
|
56
|
-
|
57
|
-
### Sinatra
|
58
|
-
|
59
|
-
For compatibility with Haml, Hamlit does not escape html automatically in sinatra.
|
60
|
-
You can enable html escaping manually:
|
61
|
-
|
62
|
-
```ruby
|
63
|
-
set :haml, { escape_html: true }
|
64
|
-
```
|
55
|
+
Just update Gemfile. Html escaping is enabled by default.
|
65
56
|
|
66
57
|
## Why high performance?
|
67
58
|
### Less work on runtime
|
data/Rakefile
CHANGED
@@ -11,16 +11,9 @@ task :spec do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
namespace :spec do
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
system('cd spec && rake ugly')
|
18
|
-
end
|
19
|
-
|
20
|
-
desc 'Generate converted pretty haml-spec'
|
21
|
-
task :pretty do
|
22
|
-
system('cd spec && rake pretty')
|
23
|
-
end
|
14
|
+
desc 'Generate converted ugly haml-spec'
|
15
|
+
task :update do
|
16
|
+
system('cd spec && rake ugly')
|
24
17
|
end
|
25
18
|
end
|
26
19
|
|
data/benchmarks/benchmark.rb
CHANGED
@@ -34,7 +34,6 @@ class Benchmarks
|
|
34
34
|
fast_erubis = Erubis::FastEruby.new(@erb_code)
|
35
35
|
haml_ugly = Haml::Engine.new(@haml_code, format: :html5, ugly: true)
|
36
36
|
tenjin = Tenjin::Engine.new.get_template(@rbhtml_path)
|
37
|
-
hamlit = Hamlit::Engine.new(escape_html: true)
|
38
37
|
|
39
38
|
context = Context.new
|
40
39
|
|
@@ -47,7 +46,7 @@ class Benchmarks
|
|
47
46
|
def run_slim_ugly; #{Slim::Engine.new.call @slim_code}; end
|
48
47
|
def run_faml; #{Faml::Engine.new.call @haml_code}; end
|
49
48
|
def run_tenjin; _buf = ''; #{tenjin.script}; end
|
50
|
-
def run_hamlit; #{
|
49
|
+
def run_hamlit; #{Hamlit::Engine.new.call @haml_code}; end
|
51
50
|
}
|
52
51
|
|
53
52
|
bench('hamlit', Hamlit::VERSION) { context.run_hamlit }
|
data/lib/hamlit/compiler.rb
CHANGED
@@ -3,7 +3,6 @@ require 'hamlit/compilers/comment'
|
|
3
3
|
require 'hamlit/compilers/doctype'
|
4
4
|
require 'hamlit/compilers/dynamic'
|
5
5
|
require 'hamlit/compilers/filter'
|
6
|
-
require 'hamlit/compilers/preserve'
|
7
6
|
require 'hamlit/compilers/script'
|
8
7
|
require 'hamlit/compilers/strip'
|
9
8
|
require 'hamlit/compilers/text'
|
@@ -16,7 +15,6 @@ module Hamlit
|
|
16
15
|
include Compilers::Doctype
|
17
16
|
include Compilers::Dynamic
|
18
17
|
include Compilers::Filter
|
19
|
-
include Compilers::Preserve
|
20
18
|
include Compilers::Script
|
21
19
|
include Compilers::Strip
|
22
20
|
include Compilers::Text
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'hamlit/compilers/new_attribute'
|
2
2
|
require 'hamlit/compilers/old_attribute'
|
3
3
|
require 'hamlit/compilers/runtime_attribute'
|
4
|
-
require 'hamlit/concerns/escapable'
|
5
4
|
require 'hamlit/concerns/included'
|
6
5
|
|
7
6
|
module Hamlit
|
@@ -13,8 +12,6 @@ module Hamlit
|
|
13
12
|
include Compilers::RuntimeAttribute
|
14
13
|
|
15
14
|
included do
|
16
|
-
include Concerns::Escapable
|
17
|
-
|
18
15
|
define_options :format, :attr_quote
|
19
16
|
end
|
20
17
|
|
@@ -41,7 +38,7 @@ module Hamlit
|
|
41
38
|
type, arg = value
|
42
39
|
next attr unless name && type && type && arg
|
43
40
|
|
44
|
-
[:html, :attr, name,
|
41
|
+
[:html, :attr, name, [:escape, true, value]]
|
45
42
|
end
|
46
43
|
end
|
47
44
|
|
@@ -1,20 +1,11 @@
|
|
1
|
-
require 'hamlit/concerns/escapable'
|
2
|
-
require 'hamlit/concerns/included'
|
3
|
-
|
4
1
|
module Hamlit
|
5
2
|
module Compilers
|
6
3
|
module Script
|
7
|
-
extend Concerns::Included
|
8
|
-
|
9
|
-
included do
|
10
|
-
include Concerns::Escapable
|
11
|
-
end
|
12
|
-
|
13
4
|
def on_haml_script(code, options, *exps)
|
14
5
|
variable = result_identifier
|
15
6
|
|
16
7
|
assign = [:code, "#{variable} = #{code}"]
|
17
|
-
result =
|
8
|
+
result = [:escape, true, [:dynamic, variable]]
|
18
9
|
result = [:dynamic, variable] if options[:disable_escape]
|
19
10
|
[:multi, assign, *exps.map { |exp| compile(exp) }, compile(result)]
|
20
11
|
end
|
data/lib/hamlit/engine.rb
CHANGED
@@ -1,21 +1,19 @@
|
|
1
1
|
require 'temple'
|
2
2
|
require 'hamlit/compiler'
|
3
|
-
require 'hamlit/html
|
4
|
-
require 'hamlit/html/ugly'
|
3
|
+
require 'hamlit/html'
|
5
4
|
require 'hamlit/parser'
|
6
5
|
|
7
6
|
module Hamlit
|
8
7
|
class Engine < Temple::Engine
|
9
8
|
define_options(
|
10
|
-
generator:
|
11
|
-
format:
|
12
|
-
attr_quote:
|
13
|
-
ugly: true,
|
9
|
+
generator: Temple::Generators::ArrayBuffer,
|
10
|
+
format: :html,
|
11
|
+
attr_quote: "'",
|
14
12
|
)
|
15
13
|
|
16
14
|
use Parser
|
17
15
|
use Compiler
|
18
|
-
use
|
16
|
+
use HTML
|
19
17
|
filter :Escapable
|
20
18
|
filter :ControlFlow
|
21
19
|
filter :MultiFlattener
|
@@ -30,13 +28,5 @@ module Hamlit
|
|
30
28
|
end
|
31
29
|
klass.new(valid_options)
|
32
30
|
end
|
33
|
-
|
34
|
-
def html_compiler
|
35
|
-
if options[:ugly]
|
36
|
-
HTML::Ugly
|
37
|
-
else
|
38
|
-
HTML::Pretty
|
39
|
-
end
|
40
|
-
end
|
41
31
|
end
|
42
32
|
end
|
data/lib/hamlit/html.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'hamlit/concerns/deprecation'
|
2
|
+
require 'temple/html/fast'
|
3
|
+
|
4
|
+
# This is created to be compatible with Haml's ugly mode.
|
5
|
+
# Currently pretty mode is not supported.
|
6
|
+
module Hamlit
|
7
|
+
class HTML < Temple::HTML::Fast
|
8
|
+
include Concerns::Deprecation
|
9
|
+
end
|
10
|
+
end
|
data/lib/hamlit/parser.rb
CHANGED
@@ -85,7 +85,7 @@ module Hamlit
|
|
85
85
|
if scanner.scan(/\\/) || scanner.match?(/\#{/)
|
86
86
|
return parse_text(scanner)
|
87
87
|
elsif scanner.match?(/&=/)
|
88
|
-
return parse_script(scanner
|
88
|
+
return parse_script(scanner)
|
89
89
|
elsif scanner.match?(/!=/)
|
90
90
|
return parse_script(scanner, disable_escape: true)
|
91
91
|
elsif scanner.match?(/[.#](\Z|[^a-zA-Z0-9_-])/)
|
@@ -97,10 +97,8 @@ module Hamlit
|
|
97
97
|
parse_doctype(scanner)
|
98
98
|
when '%', '.', '#'
|
99
99
|
parse_tag(scanner)
|
100
|
-
when '='
|
100
|
+
when '=', '~'
|
101
101
|
parse_script(scanner)
|
102
|
-
when '~'
|
103
|
-
parse_preserve(scanner)
|
104
102
|
when '-'
|
105
103
|
parse_silent_script(scanner)
|
106
104
|
when '/'
|
@@ -1,31 +1,24 @@
|
|
1
|
-
require 'hamlit/concerns/escapable'
|
2
1
|
require 'hamlit/concerns/error'
|
3
|
-
require 'hamlit/concerns/included'
|
4
2
|
require 'hamlit/concerns/indentable'
|
5
3
|
|
6
4
|
module Hamlit
|
7
5
|
module Parsers
|
8
6
|
module Script
|
9
|
-
extend Concerns::Included
|
10
7
|
include Concerns::Error
|
11
8
|
include Concerns::Indentable
|
12
9
|
|
13
10
|
INTERNAL_STATEMENTS = %w[else elsif when].freeze
|
14
|
-
DEFAULT_SCRIPT_OPTIONS = {
|
15
|
-
|
16
|
-
included do
|
17
|
-
include Concerns::Escapable
|
18
|
-
end
|
11
|
+
DEFAULT_SCRIPT_OPTIONS = { disable_escape: false }.freeze
|
19
12
|
|
20
13
|
def parse_script(scanner, options = {})
|
21
|
-
assert_scan!(scanner,
|
14
|
+
assert_scan!(scanner, /=|&=|!=|~/)
|
22
15
|
options = DEFAULT_SCRIPT_OPTIONS.merge(options)
|
23
16
|
|
24
17
|
code, with_comment = scan_code(scanner, comment_check: true)
|
25
18
|
return syntax_error("There's no Ruby code for = to evaluate.") if code.empty? && !with_comment
|
26
19
|
unless has_block?
|
27
20
|
return [:dynamic, code] if options[:disable_escape]
|
28
|
-
return
|
21
|
+
return [:escape, true, [:dynamic, code]]
|
29
22
|
end
|
30
23
|
|
31
24
|
ast = [:haml, :script, code, options]
|
@@ -34,13 +27,6 @@ module Hamlit
|
|
34
27
|
ast
|
35
28
|
end
|
36
29
|
|
37
|
-
def parse_preserve(scanner)
|
38
|
-
assert_scan!(scanner, /~/)
|
39
|
-
|
40
|
-
code = scan_code(scanner)
|
41
|
-
escape_html([:haml, :preserve, code])
|
42
|
-
end
|
43
|
-
|
44
30
|
def parse_silent_script(scanner)
|
45
31
|
assert_scan!(scanner, /-/)
|
46
32
|
if scanner.scan(/#/)
|
data/lib/hamlit/railtie.rb
CHANGED
data/lib/hamlit/version.rb
CHANGED
data/spec/Rakefile
CHANGED
@@ -10,15 +10,21 @@ def generate_spec(mode)
|
|
10
10
|
|
11
11
|
# This is a spec converted by haml-spec.
|
12
12
|
# See: https://github.com/haml/haml-spec
|
13
|
-
describe "haml #{mode} mode" do
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
describe "haml #{mode} mode with escape_html" do
|
14
|
+
DEFAULT_OPTIONS = { ugly: true, escape_html: true }.freeze
|
15
|
+
|
16
|
+
def assert_haml(haml, locals, options)
|
17
|
+
engine = Haml::Engine.new(haml, DEFAULT_OPTIONS.merge(options))
|
18
|
+
hamlit = Hamlit::Template.new(suppress_warnings(options)) { haml }
|
17
19
|
expect(hamlit.render(Object.new, locals)).to eq(engine.render(Object.new, locals))
|
18
20
|
end
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
+
# NOTE: Hamlit only supports escape_html mode.
|
23
|
+
# Thus the option is not supporeted and prints noisy warnings.
|
24
|
+
def suppress_warnings(options)
|
25
|
+
options = options.dup
|
26
|
+
options.delete(:escape_html)
|
27
|
+
options
|
22
28
|
end
|
23
29
|
|
24
30
|
SPEC
|
@@ -51,7 +57,7 @@ def generate_spec(mode)
|
|
51
57
|
end
|
52
58
|
|
53
59
|
spec += "end\n"
|
54
|
-
File.write("hamlit
|
60
|
+
File.write("hamlit/haml_spec.rb", spec)
|
55
61
|
end
|
56
62
|
|
57
63
|
def generate_specify(test, locals, options, mode)
|
@@ -61,7 +67,7 @@ def generate_specify(test, locals, options, mode)
|
|
61
67
|
html = %q{#{test[:html]}}
|
62
68
|
locals = #{locals}
|
63
69
|
options = #{options}
|
64
|
-
|
70
|
+
assert_haml(haml, locals, options)
|
65
71
|
end
|
66
72
|
SPEC
|
67
73
|
end
|
@@ -71,9 +77,4 @@ task :ugly do
|
|
71
77
|
generate_spec(:ugly)
|
72
78
|
end
|
73
79
|
|
74
|
-
|
75
|
-
task :pretty do
|
76
|
-
generate_spec(:pretty)
|
77
|
-
end
|
78
|
-
|
79
|
-
task default: [:ugly, :pretty]
|
80
|
+
task default: :ugly
|
@@ -19,7 +19,7 @@ describe Hamlit::Engine do
|
|
19
19
|
HAML
|
20
20
|
|
21
21
|
##
|
22
|
-
[
|
22
|
+
["#", "#"]
|
23
23
|
HTML
|
24
24
|
end
|
25
25
|
|
@@ -76,7 +76,7 @@ describe Hamlit::Engine do
|
|
76
76
|
end
|
77
77
|
|
78
78
|
it 'renders !=' do
|
79
|
-
assert_render(<<-HAML, <<-HTML
|
79
|
+
assert_render(<<-HAML, <<-HTML)
|
80
80
|
!= '<"&>'
|
81
81
|
!= '<"&>'.tap do |str|
|
82
82
|
-# no operation
|
@@ -87,7 +87,7 @@ describe Hamlit::Engine do
|
|
87
87
|
end
|
88
88
|
|
89
89
|
it 'renders &=' do
|
90
|
-
assert_render(<<-HAML, <<-HTML
|
90
|
+
assert_render(<<-HAML, <<-HTML)
|
91
91
|
&= '<"&>'
|
92
92
|
&= '<"&>'.tap do |str|
|
93
93
|
-# no operation
|
@@ -96,5 +96,14 @@ describe Hamlit::Engine do
|
|
96
96
|
<"&>
|
97
97
|
HTML
|
98
98
|
end
|
99
|
+
|
100
|
+
it 'regards ~ operator as =' do
|
101
|
+
assert_render(<<-'HAML', <<-HTML)
|
102
|
+
~ "<code>hello\nworld</code>"
|
103
|
+
HAML
|
104
|
+
<code>hello
|
105
|
+
world</code>
|
106
|
+
HTML
|
107
|
+
end
|
99
108
|
end
|
100
109
|
end
|
data/spec/hamlit/engine_spec.rb
CHANGED
@@ -2,15 +2,21 @@ require "haml"
|
|
2
2
|
|
3
3
|
# This is a spec converted by haml-spec.
|
4
4
|
# See: https://github.com/haml/haml-spec
|
5
|
-
describe "haml ugly mode" do
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
describe "haml ugly mode with escape_html" do
|
6
|
+
DEFAULT_OPTIONS = { ugly: true, escape_html: true }.freeze
|
7
|
+
|
8
|
+
def assert_haml(haml, locals, options)
|
9
|
+
engine = Haml::Engine.new(haml, DEFAULT_OPTIONS.merge(options))
|
10
|
+
hamlit = Hamlit::Template.new(suppress_warnings(options)) { haml }
|
9
11
|
expect(hamlit.render(Object.new, locals)).to eq(engine.render(Object.new, locals))
|
10
12
|
end
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
+
# NOTE: Hamlit only supports escape_html mode.
|
15
|
+
# Thus the option is not supporeted and prints noisy warnings.
|
16
|
+
def suppress_warnings(options)
|
17
|
+
options = options.dup
|
18
|
+
options.delete(:escape_html)
|
19
|
+
options
|
14
20
|
end
|
15
21
|
|
16
22
|
context "headers" do
|
@@ -19,7 +25,7 @@ describe "haml ugly mode" do
|
|
19
25
|
html = %q{<?xml version='1.0' encoding='utf-8' ?>}
|
20
26
|
locals = {}
|
21
27
|
options = {:format=>:xhtml}
|
22
|
-
|
28
|
+
assert_haml(haml, locals, options)
|
23
29
|
end
|
24
30
|
|
25
31
|
specify "an XHTML default (transitional) doctype" do
|
@@ -27,7 +33,7 @@ describe "haml ugly mode" do
|
|
27
33
|
html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">}
|
28
34
|
locals = {}
|
29
35
|
options = {:format=>:xhtml}
|
30
|
-
|
36
|
+
assert_haml(haml, locals, options)
|
31
37
|
end
|
32
38
|
|
33
39
|
specify "an XHTML 1.1 doctype" do
|
@@ -35,7 +41,7 @@ describe "haml ugly mode" do
|
|
35
41
|
html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">}
|
36
42
|
locals = {}
|
37
43
|
options = {:format=>:xhtml}
|
38
|
-
|
44
|
+
assert_haml(haml, locals, options)
|
39
45
|
end
|
40
46
|
|
41
47
|
specify "an XHTML 1.2 mobile doctype" do
|
@@ -43,7 +49,7 @@ describe "haml ugly mode" do
|
|
43
49
|
html = %q{<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">}
|
44
50
|
locals = {}
|
45
51
|
options = {:format=>:xhtml}
|
46
|
-
|
52
|
+
assert_haml(haml, locals, options)
|
47
53
|
end
|
48
54
|
|
49
55
|
specify "an XHTML 1.1 basic doctype" do
|
@@ -51,7 +57,7 @@ describe "haml ugly mode" do
|
|
51
57
|
html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">}
|
52
58
|
locals = {}
|
53
59
|
options = {:format=>:xhtml}
|
54
|
-
|
60
|
+
assert_haml(haml, locals, options)
|
55
61
|
end
|
56
62
|
|
57
63
|
specify "an XHTML 1.0 frameset doctype" do
|
@@ -59,7 +65,7 @@ describe "haml ugly mode" do
|
|
59
65
|
html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">}
|
60
66
|
locals = {}
|
61
67
|
options = {:format=>:xhtml}
|
62
|
-
|
68
|
+
assert_haml(haml, locals, options)
|
63
69
|
end
|
64
70
|
|
65
71
|
specify "an HTML 5 doctype with XHTML syntax" do
|
@@ -67,7 +73,7 @@ describe "haml ugly mode" do
|
|
67
73
|
html = %q{<!DOCTYPE html>}
|
68
74
|
locals = {}
|
69
75
|
options = {:format=>:xhtml}
|
70
|
-
|
76
|
+
assert_haml(haml, locals, options)
|
71
77
|
end
|
72
78
|
|
73
79
|
specify "an HTML 5 XML prolog (silent)" do
|
@@ -75,7 +81,7 @@ describe "haml ugly mode" do
|
|
75
81
|
html = %q{}
|
76
82
|
locals = {}
|
77
83
|
options = {:format=>:html5}
|
78
|
-
|
84
|
+
assert_haml(haml, locals, options)
|
79
85
|
end
|
80
86
|
|
81
87
|
specify "an HTML 5 doctype" do
|
@@ -83,7 +89,7 @@ describe "haml ugly mode" do
|
|
83
89
|
html = %q{<!DOCTYPE html>}
|
84
90
|
locals = {}
|
85
91
|
options = {:format=>:html5}
|
86
|
-
|
92
|
+
assert_haml(haml, locals, options)
|
87
93
|
end
|
88
94
|
|
89
95
|
specify "an HTML 4 XML prolog (silent)" do
|
@@ -91,7 +97,7 @@ describe "haml ugly mode" do
|
|
91
97
|
html = %q{}
|
92
98
|
locals = {}
|
93
99
|
options = {:format=>:html4}
|
94
|
-
|
100
|
+
assert_haml(haml, locals, options)
|
95
101
|
end
|
96
102
|
|
97
103
|
specify "an HTML 4 default (transitional) doctype" do
|
@@ -99,7 +105,7 @@ describe "haml ugly mode" do
|
|
99
105
|
html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">}
|
100
106
|
locals = {}
|
101
107
|
options = {:format=>:html4}
|
102
|
-
|
108
|
+
assert_haml(haml, locals, options)
|
103
109
|
end
|
104
110
|
|
105
111
|
specify "an HTML 4 frameset doctype" do
|
@@ -107,7 +113,7 @@ describe "haml ugly mode" do
|
|
107
113
|
html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">}
|
108
114
|
locals = {}
|
109
115
|
options = {:format=>:html4}
|
110
|
-
|
116
|
+
assert_haml(haml, locals, options)
|
111
117
|
end
|
112
118
|
|
113
119
|
specify "an HTML 4 strict doctype" do
|
@@ -115,7 +121,7 @@ describe "haml ugly mode" do
|
|
115
121
|
html = %q{<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">}
|
116
122
|
locals = {}
|
117
123
|
options = {:format=>:html4}
|
118
|
-
|
124
|
+
assert_haml(haml, locals, options)
|
119
125
|
end
|
120
126
|
end
|
121
127
|
|
@@ -125,7 +131,7 @@ describe "haml ugly mode" do
|
|
125
131
|
html = %q{<p></p>}
|
126
132
|
locals = {}
|
127
133
|
options = {}
|
128
|
-
|
134
|
+
assert_haml(haml, locals, options)
|
129
135
|
end
|
130
136
|
|
131
137
|
specify "a self-closing tag (XHTML)" do
|
@@ -133,7 +139,7 @@ describe "haml ugly mode" do
|
|
133
139
|
html = %q{<meta />}
|
134
140
|
locals = {}
|
135
141
|
options = {:format=>:xhtml}
|
136
|
-
|
142
|
+
assert_haml(haml, locals, options)
|
137
143
|
end
|
138
144
|
|
139
145
|
specify "a self-closing tag (HTML4)" do
|
@@ -141,7 +147,7 @@ describe "haml ugly mode" do
|
|
141
147
|
html = %q{<meta>}
|
142
148
|
locals = {}
|
143
149
|
options = {:format=>:html4}
|
144
|
-
|
150
|
+
assert_haml(haml, locals, options)
|
145
151
|
end
|
146
152
|
|
147
153
|
specify "a self-closing tag (HTML5)" do
|
@@ -149,7 +155,7 @@ describe "haml ugly mode" do
|
|
149
155
|
html = %q{<meta>}
|
150
156
|
locals = {}
|
151
157
|
options = {:format=>:html5}
|
152
|
-
|
158
|
+
assert_haml(haml, locals, options)
|
153
159
|
end
|
154
160
|
|
155
161
|
specify "a self-closing tag ('/' modifier + XHTML)" do
|
@@ -157,7 +163,7 @@ describe "haml ugly mode" do
|
|
157
163
|
html = %q{<zzz />}
|
158
164
|
locals = {}
|
159
165
|
options = {:format=>:xhtml}
|
160
|
-
|
166
|
+
assert_haml(haml, locals, options)
|
161
167
|
end
|
162
168
|
|
163
169
|
specify "a self-closing tag ('/' modifier + HTML5)" do
|
@@ -165,7 +171,7 @@ describe "haml ugly mode" do
|
|
165
171
|
html = %q{<zzz>}
|
166
172
|
locals = {}
|
167
173
|
options = {:format=>:html5}
|
168
|
-
|
174
|
+
assert_haml(haml, locals, options)
|
169
175
|
end
|
170
176
|
|
171
177
|
specify "a tag with a CSS class" do
|
@@ -173,7 +179,7 @@ describe "haml ugly mode" do
|
|
173
179
|
html = %q{<p class='class1'></p>}
|
174
180
|
locals = {}
|
175
181
|
options = {}
|
176
|
-
|
182
|
+
assert_haml(haml, locals, options)
|
177
183
|
end
|
178
184
|
|
179
185
|
specify "a tag with multiple CSS classes" do
|
@@ -181,7 +187,7 @@ describe "haml ugly mode" do
|
|
181
187
|
html = %q{<p class='class1 class2'></p>}
|
182
188
|
locals = {}
|
183
189
|
options = {}
|
184
|
-
|
190
|
+
assert_haml(haml, locals, options)
|
185
191
|
end
|
186
192
|
|
187
193
|
specify "a tag with a CSS id" do
|
@@ -189,7 +195,7 @@ describe "haml ugly mode" do
|
|
189
195
|
html = %q{<p id='id1'></p>}
|
190
196
|
locals = {}
|
191
197
|
options = {}
|
192
|
-
|
198
|
+
assert_haml(haml, locals, options)
|
193
199
|
end
|
194
200
|
|
195
201
|
specify "a tag with multiple CSS id's" do
|
@@ -197,7 +203,7 @@ describe "haml ugly mode" do
|
|
197
203
|
html = %q{<p id='id2'></p>}
|
198
204
|
locals = {}
|
199
205
|
options = {}
|
200
|
-
|
206
|
+
assert_haml(haml, locals, options)
|
201
207
|
end
|
202
208
|
|
203
209
|
specify "a tag with a class followed by an id" do
|
@@ -205,7 +211,7 @@ describe "haml ugly mode" do
|
|
205
211
|
html = %q{<p class='class1' id='id1'></p>}
|
206
212
|
locals = {}
|
207
213
|
options = {}
|
208
|
-
|
214
|
+
assert_haml(haml, locals, options)
|
209
215
|
end
|
210
216
|
|
211
217
|
specify "a tag with an id followed by a class" do
|
@@ -213,7 +219,7 @@ describe "haml ugly mode" do
|
|
213
219
|
html = %q{<p class='class1' id='id1'></p>}
|
214
220
|
locals = {}
|
215
221
|
options = {}
|
216
|
-
|
222
|
+
assert_haml(haml, locals, options)
|
217
223
|
end
|
218
224
|
|
219
225
|
specify "an implicit div with a CSS id" do
|
@@ -221,7 +227,7 @@ describe "haml ugly mode" do
|
|
221
227
|
html = %q{<div id='id1'></div>}
|
222
228
|
locals = {}
|
223
229
|
options = {}
|
224
|
-
|
230
|
+
assert_haml(haml, locals, options)
|
225
231
|
end
|
226
232
|
|
227
233
|
specify "an implicit div with a CSS class" do
|
@@ -229,7 +235,7 @@ describe "haml ugly mode" do
|
|
229
235
|
html = %q{<div class='class1'></div>}
|
230
236
|
locals = {}
|
231
237
|
options = {}
|
232
|
-
|
238
|
+
assert_haml(haml, locals, options)
|
233
239
|
end
|
234
240
|
|
235
241
|
specify "multiple simple Haml tags" do
|
@@ -243,7 +249,7 @@ describe "haml ugly mode" do
|
|
243
249
|
</div>}
|
244
250
|
locals = {}
|
245
251
|
options = {}
|
246
|
-
|
252
|
+
assert_haml(haml, locals, options)
|
247
253
|
end
|
248
254
|
end
|
249
255
|
|
@@ -253,7 +259,7 @@ describe "haml ugly mode" do
|
|
253
259
|
html = %q{<ns:tag></ns:tag>}
|
254
260
|
locals = {}
|
255
261
|
options = {}
|
256
|
-
|
262
|
+
assert_haml(haml, locals, options)
|
257
263
|
end
|
258
264
|
|
259
265
|
specify "a tag with underscores" do
|
@@ -261,7 +267,7 @@ describe "haml ugly mode" do
|
|
261
267
|
html = %q{<snake_case></snake_case>}
|
262
268
|
locals = {}
|
263
269
|
options = {}
|
264
|
-
|
270
|
+
assert_haml(haml, locals, options)
|
265
271
|
end
|
266
272
|
|
267
273
|
specify "a tag with dashes" do
|
@@ -269,7 +275,7 @@ describe "haml ugly mode" do
|
|
269
275
|
html = %q{<dashed-tag></dashed-tag>}
|
270
276
|
locals = {}
|
271
277
|
options = {}
|
272
|
-
|
278
|
+
assert_haml(haml, locals, options)
|
273
279
|
end
|
274
280
|
|
275
281
|
specify "a tag with camelCase" do
|
@@ -277,7 +283,7 @@ describe "haml ugly mode" do
|
|
277
283
|
html = %q{<camelCase></camelCase>}
|
278
284
|
locals = {}
|
279
285
|
options = {}
|
280
|
-
|
286
|
+
assert_haml(haml, locals, options)
|
281
287
|
end
|
282
288
|
|
283
289
|
specify "a tag with PascalCase" do
|
@@ -285,7 +291,7 @@ describe "haml ugly mode" do
|
|
285
291
|
html = %q{<PascalCase></PascalCase>}
|
286
292
|
locals = {}
|
287
293
|
options = {}
|
288
|
-
|
294
|
+
assert_haml(haml, locals, options)
|
289
295
|
end
|
290
296
|
end
|
291
297
|
|
@@ -295,7 +301,7 @@ describe "haml ugly mode" do
|
|
295
301
|
html = %q{<div class='123'></div>}
|
296
302
|
locals = {}
|
297
303
|
options = {}
|
298
|
-
|
304
|
+
assert_haml(haml, locals, options)
|
299
305
|
end
|
300
306
|
|
301
307
|
specify "a class with underscores" do
|
@@ -303,7 +309,7 @@ describe "haml ugly mode" do
|
|
303
309
|
html = %q{<div class='__'></div>}
|
304
310
|
locals = {}
|
305
311
|
options = {}
|
306
|
-
|
312
|
+
assert_haml(haml, locals, options)
|
307
313
|
end
|
308
314
|
|
309
315
|
specify "a class with dashes" do
|
@@ -311,7 +317,7 @@ describe "haml ugly mode" do
|
|
311
317
|
html = %q{<div class='--'></div>}
|
312
318
|
locals = {}
|
313
319
|
options = {}
|
314
|
-
|
320
|
+
assert_haml(haml, locals, options)
|
315
321
|
end
|
316
322
|
end
|
317
323
|
|
@@ -321,7 +327,7 @@ describe "haml ugly mode" do
|
|
321
327
|
html = %q{<p>hello</p>}
|
322
328
|
locals = {}
|
323
329
|
options = {}
|
324
|
-
|
330
|
+
assert_haml(haml, locals, options)
|
325
331
|
end
|
326
332
|
|
327
333
|
specify "Inline content tag with CSS" do
|
@@ -329,7 +335,7 @@ describe "haml ugly mode" do
|
|
329
335
|
html = %q{<p class='class1'>hello</p>}
|
330
336
|
locals = {}
|
331
337
|
options = {}
|
332
|
-
|
338
|
+
assert_haml(haml, locals, options)
|
333
339
|
end
|
334
340
|
|
335
341
|
specify "Inline content multiple simple tags" do
|
@@ -343,7 +349,7 @@ describe "haml ugly mode" do
|
|
343
349
|
</div>}
|
344
350
|
locals = {}
|
345
351
|
options = {}
|
346
|
-
|
352
|
+
assert_haml(haml, locals, options)
|
347
353
|
end
|
348
354
|
end
|
349
355
|
|
@@ -356,7 +362,7 @@ describe "haml ugly mode" do
|
|
356
362
|
</p>}
|
357
363
|
locals = {}
|
358
364
|
options = {}
|
359
|
-
|
365
|
+
assert_haml(haml, locals, options)
|
360
366
|
end
|
361
367
|
|
362
368
|
specify "Nested content tag with CSS" do
|
@@ -367,7 +373,7 @@ describe "haml ugly mode" do
|
|
367
373
|
</p>}
|
368
374
|
locals = {}
|
369
375
|
options = {}
|
370
|
-
|
376
|
+
assert_haml(haml, locals, options)
|
371
377
|
end
|
372
378
|
|
373
379
|
specify "Nested content multiple simple tags" do
|
@@ -384,7 +390,7 @@ describe "haml ugly mode" do
|
|
384
390
|
</div>}
|
385
391
|
locals = {}
|
386
392
|
options = {}
|
387
|
-
|
393
|
+
assert_haml(haml, locals, options)
|
388
394
|
end
|
389
395
|
end
|
390
396
|
|
@@ -394,7 +400,7 @@ describe "haml ugly mode" do
|
|
394
400
|
html = %q{<p a='b'></p>}
|
395
401
|
locals = {}
|
396
402
|
options = {}
|
397
|
-
|
403
|
+
assert_haml(haml, locals, options)
|
398
404
|
end
|
399
405
|
|
400
406
|
specify "HTML-style multiple attributes" do
|
@@ -402,7 +408,7 @@ describe "haml ugly mode" do
|
|
402
408
|
html = %q{<p a='b' c='d'></p>}
|
403
409
|
locals = {}
|
404
410
|
options = {}
|
405
|
-
|
411
|
+
assert_haml(haml, locals, options)
|
406
412
|
end
|
407
413
|
|
408
414
|
specify "HTML-style attributes separated with newlines" do
|
@@ -411,7 +417,7 @@ describe "haml ugly mode" do
|
|
411
417
|
html = %q{<p a='b' c='d'></p>}
|
412
418
|
locals = {}
|
413
419
|
options = {}
|
414
|
-
|
420
|
+
assert_haml(haml, locals, options)
|
415
421
|
end
|
416
422
|
|
417
423
|
specify "HTML-style interpolated attribute" do
|
@@ -419,7 +425,7 @@ describe "haml ugly mode" do
|
|
419
425
|
html = %q{<p a='value'></p>}
|
420
426
|
locals = {:var=>"value"}
|
421
427
|
options = {}
|
422
|
-
|
428
|
+
assert_haml(haml, locals, options)
|
423
429
|
end
|
424
430
|
|
425
431
|
specify "HTML-style 'class' as an attribute" do
|
@@ -427,7 +433,7 @@ describe "haml ugly mode" do
|
|
427
433
|
html = %q{<p class='class1'></p>}
|
428
434
|
locals = {}
|
429
435
|
options = {}
|
430
|
-
|
436
|
+
assert_haml(haml, locals, options)
|
431
437
|
end
|
432
438
|
|
433
439
|
specify "HTML-style tag with a CSS class and 'class' as an attribute" do
|
@@ -435,7 +441,7 @@ describe "haml ugly mode" do
|
|
435
441
|
html = %q{<p class='class1 class2'></p>}
|
436
442
|
locals = {}
|
437
443
|
options = {}
|
438
|
-
|
444
|
+
assert_haml(haml, locals, options)
|
439
445
|
end
|
440
446
|
|
441
447
|
specify "HTML-style tag with 'id' as an attribute" do
|
@@ -443,7 +449,7 @@ describe "haml ugly mode" do
|
|
443
449
|
html = %q{<p id='1'></p>}
|
444
450
|
locals = {}
|
445
451
|
options = {}
|
446
|
-
|
452
|
+
assert_haml(haml, locals, options)
|
447
453
|
end
|
448
454
|
|
449
455
|
specify "HTML-style tag with a CSS id and 'id' as an attribute" do
|
@@ -451,7 +457,7 @@ describe "haml ugly mode" do
|
|
451
457
|
html = %q{<p id='id_1'></p>}
|
452
458
|
locals = {}
|
453
459
|
options = {}
|
454
|
-
|
460
|
+
assert_haml(haml, locals, options)
|
455
461
|
end
|
456
462
|
|
457
463
|
specify "HTML-style tag with a variable attribute" do
|
@@ -459,7 +465,7 @@ describe "haml ugly mode" do
|
|
459
465
|
html = %q{<p class='hello'></p>}
|
460
466
|
locals = {:var=>"hello"}
|
461
467
|
options = {}
|
462
|
-
|
468
|
+
assert_haml(haml, locals, options)
|
463
469
|
end
|
464
470
|
|
465
471
|
specify "HTML-style tag with a CSS class and 'class' as a variable attribute" do
|
@@ -467,7 +473,7 @@ describe "haml ugly mode" do
|
|
467
473
|
html = %q{<div class='hello world'></div>}
|
468
474
|
locals = {:var=>"world"}
|
469
475
|
options = {}
|
470
|
-
|
476
|
+
assert_haml(haml, locals, options)
|
471
477
|
end
|
472
478
|
|
473
479
|
specify "HTML-style tag multiple CSS classes (sorted correctly)" do
|
@@ -475,7 +481,7 @@ describe "haml ugly mode" do
|
|
475
481
|
html = %q{<div class='a z'></div>}
|
476
482
|
locals = {:var=>"a"}
|
477
483
|
options = {}
|
478
|
-
|
484
|
+
assert_haml(haml, locals, options)
|
479
485
|
end
|
480
486
|
|
481
487
|
specify "HTML-style tag with an atomic attribute" do
|
@@ -483,7 +489,7 @@ describe "haml ugly mode" do
|
|
483
489
|
html = %q{<a flag></a>}
|
484
490
|
locals = {}
|
485
491
|
options = {}
|
486
|
-
|
492
|
+
assert_haml(haml, locals, options)
|
487
493
|
end
|
488
494
|
end
|
489
495
|
|
@@ -493,7 +499,7 @@ describe "haml ugly mode" do
|
|
493
499
|
html = %q{<p a='b'></p>}
|
494
500
|
locals = {}
|
495
501
|
options = {}
|
496
|
-
|
502
|
+
assert_haml(haml, locals, options)
|
497
503
|
end
|
498
504
|
|
499
505
|
specify "Ruby-style attributes hash with whitespace" do
|
@@ -501,7 +507,7 @@ describe "haml ugly mode" do
|
|
501
507
|
html = %q{<p a='b'></p>}
|
502
508
|
locals = {}
|
503
509
|
options = {}
|
504
|
-
|
510
|
+
assert_haml(haml, locals, options)
|
505
511
|
end
|
506
512
|
|
507
513
|
specify "Ruby-style interpolated attribute" do
|
@@ -509,7 +515,7 @@ describe "haml ugly mode" do
|
|
509
515
|
html = %q{<p a='value'></p>}
|
510
516
|
locals = {:var=>"value"}
|
511
517
|
options = {}
|
512
|
-
|
518
|
+
assert_haml(haml, locals, options)
|
513
519
|
end
|
514
520
|
|
515
521
|
specify "Ruby-style multiple attributes" do
|
@@ -517,7 +523,7 @@ describe "haml ugly mode" do
|
|
517
523
|
html = %q{<p a='b' c='d'></p>}
|
518
524
|
locals = {}
|
519
525
|
options = {}
|
520
|
-
|
526
|
+
assert_haml(haml, locals, options)
|
521
527
|
end
|
522
528
|
|
523
529
|
specify "Ruby-style attributes separated with newlines" do
|
@@ -526,7 +532,7 @@ describe "haml ugly mode" do
|
|
526
532
|
html = %q{<p a='b' c='d'></p>}
|
527
533
|
locals = {}
|
528
534
|
options = {}
|
529
|
-
|
535
|
+
assert_haml(haml, locals, options)
|
530
536
|
end
|
531
537
|
|
532
538
|
specify "Ruby-style 'class' as an attribute" do
|
@@ -534,7 +540,7 @@ describe "haml ugly mode" do
|
|
534
540
|
html = %q{<p class='class1'></p>}
|
535
541
|
locals = {}
|
536
542
|
options = {}
|
537
|
-
|
543
|
+
assert_haml(haml, locals, options)
|
538
544
|
end
|
539
545
|
|
540
546
|
specify "Ruby-style tag with a CSS class and 'class' as an attribute" do
|
@@ -542,7 +548,7 @@ describe "haml ugly mode" do
|
|
542
548
|
html = %q{<p class='class1 class2'></p>}
|
543
549
|
locals = {}
|
544
550
|
options = {}
|
545
|
-
|
551
|
+
assert_haml(haml, locals, options)
|
546
552
|
end
|
547
553
|
|
548
554
|
specify "Ruby-style tag with 'id' as an attribute" do
|
@@ -550,7 +556,7 @@ describe "haml ugly mode" do
|
|
550
556
|
html = %q{<p id='1'></p>}
|
551
557
|
locals = {}
|
552
558
|
options = {}
|
553
|
-
|
559
|
+
assert_haml(haml, locals, options)
|
554
560
|
end
|
555
561
|
|
556
562
|
specify "Ruby-style tag with a CSS id and 'id' as an attribute" do
|
@@ -558,7 +564,7 @@ describe "haml ugly mode" do
|
|
558
564
|
html = %q{<p id='id_1'></p>}
|
559
565
|
locals = {}
|
560
566
|
options = {}
|
561
|
-
|
567
|
+
assert_haml(haml, locals, options)
|
562
568
|
end
|
563
569
|
|
564
570
|
specify "Ruby-style tag with a CSS id and a numeric 'id' as an attribute" do
|
@@ -566,7 +572,7 @@ describe "haml ugly mode" do
|
|
566
572
|
html = %q{<p id='id_1'></p>}
|
567
573
|
locals = {}
|
568
574
|
options = {}
|
569
|
-
|
575
|
+
assert_haml(haml, locals, options)
|
570
576
|
end
|
571
577
|
|
572
578
|
specify "Ruby-style tag with a variable attribute" do
|
@@ -574,7 +580,7 @@ describe "haml ugly mode" do
|
|
574
580
|
html = %q{<p class='hello'></p>}
|
575
581
|
locals = {:var=>"hello"}
|
576
582
|
options = {}
|
577
|
-
|
583
|
+
assert_haml(haml, locals, options)
|
578
584
|
end
|
579
585
|
|
580
586
|
specify "Ruby-style tag with a CSS class and 'class' as a variable attribute" do
|
@@ -582,7 +588,7 @@ describe "haml ugly mode" do
|
|
582
588
|
html = %q{<div class='hello world'></div>}
|
583
589
|
locals = {:var=>"world"}
|
584
590
|
options = {}
|
585
|
-
|
591
|
+
assert_haml(haml, locals, options)
|
586
592
|
end
|
587
593
|
|
588
594
|
specify "Ruby-style tag multiple CSS classes (sorted correctly)" do
|
@@ -590,7 +596,7 @@ describe "haml ugly mode" do
|
|
590
596
|
html = %q{<div class='a z'></div>}
|
591
597
|
locals = {:var=>"a"}
|
592
598
|
options = {}
|
593
|
-
|
599
|
+
assert_haml(haml, locals, options)
|
594
600
|
end
|
595
601
|
end
|
596
602
|
|
@@ -600,7 +606,7 @@ describe "haml ugly mode" do
|
|
600
606
|
html = %q{}
|
601
607
|
locals = {}
|
602
608
|
options = {}
|
603
|
-
|
609
|
+
assert_haml(haml, locals, options)
|
604
610
|
end
|
605
611
|
|
606
612
|
specify "a nested silent comment" do
|
@@ -609,7 +615,7 @@ describe "haml ugly mode" do
|
|
609
615
|
html = %q{}
|
610
616
|
locals = {}
|
611
617
|
options = {}
|
612
|
-
|
618
|
+
assert_haml(haml, locals, options)
|
613
619
|
end
|
614
620
|
|
615
621
|
specify "a multiply nested silent comment" do
|
@@ -619,7 +625,7 @@ describe "haml ugly mode" do
|
|
619
625
|
html = %q{}
|
620
626
|
locals = {}
|
621
627
|
options = {}
|
622
|
-
|
628
|
+
assert_haml(haml, locals, options)
|
623
629
|
end
|
624
630
|
|
625
631
|
specify "a multiply nested silent comment with inconsistent indents" do
|
@@ -629,7 +635,7 @@ describe "haml ugly mode" do
|
|
629
635
|
html = %q{}
|
630
636
|
locals = {}
|
631
637
|
options = {}
|
632
|
-
|
638
|
+
assert_haml(haml, locals, options)
|
633
639
|
end
|
634
640
|
end
|
635
641
|
|
@@ -639,7 +645,7 @@ describe "haml ugly mode" do
|
|
639
645
|
html = %q{<!-- comment -->}
|
640
646
|
locals = {}
|
641
647
|
options = {}
|
642
|
-
|
648
|
+
assert_haml(haml, locals, options)
|
643
649
|
end
|
644
650
|
|
645
651
|
specify "a nested markup comment" do
|
@@ -652,7 +658,7 @@ describe "haml ugly mode" do
|
|
652
658
|
-->}
|
653
659
|
locals = {}
|
654
660
|
options = {}
|
655
|
-
|
661
|
+
assert_haml(haml, locals, options)
|
656
662
|
end
|
657
663
|
end
|
658
664
|
|
@@ -665,7 +671,7 @@ describe "haml ugly mode" do
|
|
665
671
|
<![endif]-->}
|
666
672
|
locals = {}
|
667
673
|
options = {}
|
668
|
-
|
674
|
+
assert_haml(haml, locals, options)
|
669
675
|
end
|
670
676
|
end
|
671
677
|
|
@@ -676,7 +682,7 @@ describe "haml ugly mode" do
|
|
676
682
|
html = %q{<&">}
|
677
683
|
locals = {}
|
678
684
|
options = {}
|
679
|
-
|
685
|
+
assert_haml(haml, locals, options)
|
680
686
|
end
|
681
687
|
|
682
688
|
specify "content in a 'preserve' filter" do
|
@@ -688,7 +694,7 @@ describe "haml ugly mode" do
|
|
688
694
|
<p></p>}
|
689
695
|
locals = {}
|
690
696
|
options = {}
|
691
|
-
|
697
|
+
assert_haml(haml, locals, options)
|
692
698
|
end
|
693
699
|
|
694
700
|
specify "content in a 'plain' filter" do
|
@@ -700,7 +706,7 @@ describe "haml ugly mode" do
|
|
700
706
|
<p></p>}
|
701
707
|
locals = {}
|
702
708
|
options = {}
|
703
|
-
|
709
|
+
assert_haml(haml, locals, options)
|
704
710
|
end
|
705
711
|
|
706
712
|
specify "content in a 'css' filter (XHTML)" do
|
@@ -716,7 +722,7 @@ describe "haml ugly mode" do
|
|
716
722
|
<p></p>}
|
717
723
|
locals = {}
|
718
724
|
options = {:format=>:xhtml}
|
719
|
-
|
725
|
+
assert_haml(haml, locals, options)
|
720
726
|
end
|
721
727
|
|
722
728
|
specify "content in a 'javascript' filter (XHTML)" do
|
@@ -731,7 +737,7 @@ describe "haml ugly mode" do
|
|
731
737
|
<p></p>}
|
732
738
|
locals = {}
|
733
739
|
options = {:format=>:xhtml}
|
734
|
-
|
740
|
+
assert_haml(haml, locals, options)
|
735
741
|
end
|
736
742
|
|
737
743
|
specify "content in a 'css' filter (HTML)" do
|
@@ -745,7 +751,7 @@ describe "haml ugly mode" do
|
|
745
751
|
<p></p>}
|
746
752
|
locals = {}
|
747
753
|
options = {:format=>:html5}
|
748
|
-
|
754
|
+
assert_haml(haml, locals, options)
|
749
755
|
end
|
750
756
|
|
751
757
|
specify "content in a 'javascript' filter (HTML)" do
|
@@ -758,7 +764,7 @@ describe "haml ugly mode" do
|
|
758
764
|
<p></p>}
|
759
765
|
locals = {}
|
760
766
|
options = {:format=>:html5}
|
761
|
-
|
767
|
+
assert_haml(haml, locals, options)
|
762
768
|
end
|
763
769
|
end
|
764
770
|
|
@@ -768,7 +774,7 @@ describe "haml ugly mode" do
|
|
768
774
|
html = %q{<p>value</p>}
|
769
775
|
locals = {:var=>"value"}
|
770
776
|
options = {}
|
771
|
-
|
777
|
+
assert_haml(haml, locals, options)
|
772
778
|
end
|
773
779
|
|
774
780
|
specify "no interpolation when escaped" do
|
@@ -776,7 +782,7 @@ describe "haml ugly mode" do
|
|
776
782
|
html = %q{<p>#{var}</p>}
|
777
783
|
locals = {:var=>"value"}
|
778
784
|
options = {}
|
779
|
-
|
785
|
+
assert_haml(haml, locals, options)
|
780
786
|
end
|
781
787
|
|
782
788
|
specify "interpolation when the escape character is escaped" do
|
@@ -784,7 +790,7 @@ describe "haml ugly mode" do
|
|
784
790
|
html = %q{<p>\value</p>}
|
785
791
|
locals = {:var=>"value"}
|
786
792
|
options = {}
|
787
|
-
|
793
|
+
assert_haml(haml, locals, options)
|
788
794
|
end
|
789
795
|
|
790
796
|
specify "interpolation inside filtered content" do
|
@@ -793,7 +799,7 @@ describe "haml ugly mode" do
|
|
793
799
|
html = %q{value interpolated: value}
|
794
800
|
locals = {:var=>"value"}
|
795
801
|
options = {}
|
796
|
-
|
802
|
+
assert_haml(haml, locals, options)
|
797
803
|
end
|
798
804
|
end
|
799
805
|
|
@@ -803,7 +809,7 @@ describe "haml ugly mode" do
|
|
803
809
|
html = %q{<"&>}
|
804
810
|
locals = {}
|
805
811
|
options = {}
|
806
|
-
|
812
|
+
assert_haml(haml, locals, options)
|
807
813
|
end
|
808
814
|
|
809
815
|
specify "code following '=' when escape_haml is set to true" do
|
@@ -811,7 +817,7 @@ describe "haml ugly mode" do
|
|
811
817
|
html = %q{<"&>}
|
812
818
|
locals = {}
|
813
819
|
options = {:escape_html=>"true"}
|
814
|
-
|
820
|
+
assert_haml(haml, locals, options)
|
815
821
|
end
|
816
822
|
|
817
823
|
specify "code following '!=' when escape_haml is set to true" do
|
@@ -819,7 +825,7 @@ describe "haml ugly mode" do
|
|
819
825
|
html = %q{<"&>}
|
820
826
|
locals = {}
|
821
827
|
options = {:escape_html=>"true"}
|
822
|
-
|
828
|
+
assert_haml(haml, locals, options)
|
823
829
|
end
|
824
830
|
end
|
825
831
|
|
@@ -829,7 +835,7 @@ describe "haml ugly mode" do
|
|
829
835
|
html = %q{<input checked='checked' />}
|
830
836
|
locals = {}
|
831
837
|
options = {:format=>:xhtml}
|
832
|
-
|
838
|
+
assert_haml(haml, locals, options)
|
833
839
|
end
|
834
840
|
|
835
841
|
specify "boolean attribute with HTML" do
|
@@ -837,7 +843,7 @@ describe "haml ugly mode" do
|
|
837
843
|
html = %q{<input checked>}
|
838
844
|
locals = {}
|
839
845
|
options = {:format=>:html5}
|
840
|
-
|
846
|
+
assert_haml(haml, locals, options)
|
841
847
|
end
|
842
848
|
end
|
843
849
|
|
@@ -848,7 +854,7 @@ describe "haml ugly mode" do
|
|
848
854
|
<pre>Bar
Baz</pre>}
|
849
855
|
locals = {}
|
850
856
|
options = {}
|
851
|
-
|
857
|
+
assert_haml(haml, locals, options)
|
852
858
|
end
|
853
859
|
|
854
860
|
specify "inside a textarea tag" do
|
@@ -859,7 +865,7 @@ describe "haml ugly mode" do
|
|
859
865
|
hello</textarea>}
|
860
866
|
locals = {}
|
861
867
|
options = {}
|
862
|
-
|
868
|
+
assert_haml(haml, locals, options)
|
863
869
|
end
|
864
870
|
|
865
871
|
specify "inside a pre tag" do
|
@@ -870,7 +876,7 @@ hello</textarea>}
|
|
870
876
|
hello</pre>}
|
871
877
|
locals = {}
|
872
878
|
options = {}
|
873
|
-
|
879
|
+
assert_haml(haml, locals, options)
|
874
880
|
end
|
875
881
|
end
|
876
882
|
|
@@ -882,7 +888,7 @@ hello</pre>}
|
|
882
888
|
html = %q{<li>hello</li><li>world</li><li>again</li>}
|
883
889
|
locals = {}
|
884
890
|
options = {}
|
885
|
-
|
891
|
+
assert_haml(haml, locals, options)
|
886
892
|
end
|
887
893
|
|
888
894
|
specify "a tag with '>' appended and nested content" do
|
@@ -895,7 +901,7 @@ hello</pre>}
|
|
895
901
|
</li><li>again</li>}
|
896
902
|
locals = {}
|
897
903
|
options = {}
|
898
|
-
|
904
|
+
assert_haml(haml, locals, options)
|
899
905
|
end
|
900
906
|
|
901
907
|
specify "a tag with '<' appended" do
|
@@ -906,7 +912,7 @@ hello</pre>}
|
|
906
912
|
world</p>}
|
907
913
|
locals = {}
|
908
914
|
options = {}
|
909
|
-
|
915
|
+
assert_haml(haml, locals, options)
|
910
916
|
end
|
911
917
|
end
|
912
918
|
end
|