hamlit 1.5.9 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/doc/README.md +15 -2
- data/doc/engine/indent.md +24 -0
- data/doc/engine/new_attribute.md +77 -0
- data/doc/engine/old_attributes.md +127 -0
- data/doc/engine/silent_script.md +97 -0
- data/doc/engine/tag.md +48 -0
- data/doc/engine/text.md +7 -1
- data/doc/faml/README.md +19 -0
- data/doc/faml/engine/indent.md +24 -0
- data/doc/faml/engine/old_attributes.md +108 -0
- data/doc/faml/engine/silent_script.md +97 -0
- data/doc/faml/engine/text.md +35 -0
- data/doc/faml/filters/coffee.md +125 -0
- data/doc/faml/filters/erb.md +24 -0
- data/doc/faml/filters/javascript.md +27 -0
- data/doc/faml/filters/less.md +57 -0
- data/doc/faml/filters/plain.md +25 -0
- data/doc/faml/filters/sass.md +62 -0
- data/doc/faml/filters/scss.md +68 -0
- data/doc/haml/README.md +15 -0
- data/doc/haml/engine/new_attribute.md +77 -0
- data/doc/haml/engine/old_attributes.md +142 -0
- data/doc/haml/engine/tag.md +48 -0
- data/doc/haml/engine/text.md +59 -0
- data/doc/haml/filters/erb.md +26 -0
- data/doc/haml/filters/javascript.md +76 -0
- data/doc/haml/filters/markdown.md +31 -0
- data/lib/hamlit/compilers/attributes.rb +1 -1
- data/lib/hamlit/compilers/new_attribute.rb +6 -6
- data/lib/hamlit/compilers/old_attribute.rb +2 -2
- data/lib/hamlit/compilers/text.rb +7 -10
- data/lib/hamlit/concerns/lexable.rb +32 -0
- data/lib/hamlit/parser.rb +9 -8
- data/lib/hamlit/parsers/attribute.rb +6 -3
- data/lib/hamlit/version.rb +1 -1
- data/spec/hamlit/engine/indent_spec.rb +1 -1
- data/spec/hamlit/engine/new_attribute_spec.rb +13 -2
- data/spec/hamlit/engine/old_attributes_spec.rb +5 -5
- data/spec/hamlit/engine/silent_script_spec.rb +4 -4
- data/spec/hamlit/engine/tag_spec.rb +23 -0
- data/spec/hamlit/engine/text_spec.rb +7 -3
- data/spec/spec_helper.rb +7 -231
- data/spec/spec_helper/document_generator.rb +93 -0
- data/spec/spec_helper/render_helper.rb +112 -0
- data/spec/spec_helper/test_case.rb +55 -0
- metadata +33 -3
- data/lib/hamlit/concerns/ripperable.rb +0 -20
data/doc/faml/README.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Hamlit incompatibilities
|
2
|
+
This is a document generated from RSpec test cases.
|
3
|
+
Showing incompatibilities against [Faml](https://github.com/eagletmt/faml).
|
4
|
+
|
5
|
+
## engine
|
6
|
+
- [engine/indent\_spec.rb](engine/indent.md)
|
7
|
+
- [engine/old\_attributes\_spec.rb](engine/old_attributes.md)
|
8
|
+
- [engine/silent\_script\_spec.rb](engine/silent_script.md)
|
9
|
+
- [engine/text\_spec.rb](engine/text.md)
|
10
|
+
|
11
|
+
|
12
|
+
## filters
|
13
|
+
- [filters/coffee\_spec.rb](filters/coffee.md)
|
14
|
+
- [filters/erb\_spec.rb](filters/erb.md)
|
15
|
+
- [filters/javascript\_spec.rb](filters/javascript.md)
|
16
|
+
- [filters/less\_spec.rb](filters/less.md)
|
17
|
+
- [filters/plain\_spec.rb](filters/plain.md)
|
18
|
+
- [filters/sass\_spec.rb](filters/sass.md)
|
19
|
+
- [filters/scss\_spec.rb](filters/scss.md)
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# [old\_attributes\_spec.rb:43](/spec/hamlit/engine/old_attributes_spec.rb#L43)
|
2
|
+
## Input
|
3
|
+
```haml
|
4
|
+
%span{ class: '}}}', id: '{}}' } }{
|
5
|
+
|
6
|
+
```
|
7
|
+
|
8
|
+
## Output
|
9
|
+
### Faml
|
10
|
+
```html
|
11
|
+
Faml::Compiler::UnparsableRubyCode: Unparsable Ruby code is given to attributes: class: '
|
12
|
+
```
|
13
|
+
|
14
|
+
### Hamlit
|
15
|
+
```html
|
16
|
+
<span class='}}}' id='{}}'>}{</span>
|
17
|
+
|
18
|
+
```
|
19
|
+
|
20
|
+
|
21
|
+
# [old\_attributes\_spec.rb:124](/spec/hamlit/engine/old_attributes_spec.rb#L124)
|
22
|
+
## Input
|
23
|
+
```haml
|
24
|
+
.foo{ class: ['bar'] }
|
25
|
+
.foo{ class: ['bar', nil] }
|
26
|
+
.foo{ class: ['bar', 'baz'] }
|
27
|
+
|
28
|
+
```
|
29
|
+
|
30
|
+
## Output
|
31
|
+
### Faml
|
32
|
+
```html
|
33
|
+
<div class='bar foo'></div>
|
34
|
+
<div class=' bar foo'></div>
|
35
|
+
<div class='bar baz foo'></div>
|
36
|
+
|
37
|
+
```
|
38
|
+
|
39
|
+
### Hamlit
|
40
|
+
```html
|
41
|
+
<div class='bar foo'></div>
|
42
|
+
<div class='bar foo'></div>
|
43
|
+
<div class='bar baz foo'></div>
|
44
|
+
|
45
|
+
```
|
46
|
+
|
47
|
+
|
48
|
+
# [old\_attributes\_spec.rb:201](/spec/hamlit/engine/old_attributes_spec.rb#L201)
|
49
|
+
## Input
|
50
|
+
```haml
|
51
|
+
/ wontfix: Non-boolean attributes are not escaped for optimization.
|
52
|
+
- val = false
|
53
|
+
%a{ href: val }
|
54
|
+
- val = nil
|
55
|
+
%a{ href: val }
|
56
|
+
|
57
|
+
/ Boolean attributes are escaped correctly.
|
58
|
+
- val = false
|
59
|
+
%a{ disabled: val }
|
60
|
+
- val = nil
|
61
|
+
%a{ disabled: val }
|
62
|
+
|
63
|
+
```
|
64
|
+
|
65
|
+
## Output
|
66
|
+
### Faml
|
67
|
+
```html
|
68
|
+
<!-- wontfix: Non-boolean attributes are not escaped for optimization. -->
|
69
|
+
<a></a>
|
70
|
+
<a></a>
|
71
|
+
<!-- Boolean attributes are escaped correctly. -->
|
72
|
+
<a></a>
|
73
|
+
<a></a>
|
74
|
+
|
75
|
+
```
|
76
|
+
|
77
|
+
### Hamlit
|
78
|
+
```html
|
79
|
+
<!-- wontfix: Non-boolean attributes are not escaped for optimization. -->
|
80
|
+
<a href='false'></a>
|
81
|
+
<a href=''></a>
|
82
|
+
<!-- Boolean attributes are escaped correctly. -->
|
83
|
+
<a></a>
|
84
|
+
<a></a>
|
85
|
+
|
86
|
+
```
|
87
|
+
|
88
|
+
|
89
|
+
# [old\_attributes\_spec.rb:273](/spec/hamlit/engine/old_attributes_spec.rb#L273)
|
90
|
+
## Input
|
91
|
+
```haml
|
92
|
+
%span{ data: { disable: true } } bar
|
93
|
+
|
94
|
+
```
|
95
|
+
|
96
|
+
## Output
|
97
|
+
### Faml
|
98
|
+
```html
|
99
|
+
<span data-disable='true'>bar</span>
|
100
|
+
|
101
|
+
```
|
102
|
+
|
103
|
+
### Hamlit
|
104
|
+
```html
|
105
|
+
<span data-disable>bar</span>
|
106
|
+
|
107
|
+
```
|
108
|
+
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# [silent\_script\_spec.rb:79](/spec/hamlit/engine/silent_script_spec.rb#L79)
|
2
|
+
## Input
|
3
|
+
```haml
|
4
|
+
%span
|
5
|
+
- if false
|
6
|
+
- elsif false
|
7
|
+
|
8
|
+
```
|
9
|
+
|
10
|
+
## Output
|
11
|
+
### Faml
|
12
|
+
```html
|
13
|
+
SyntaxError: (eval):4: syntax error, unexpected end-of-input, expecting keyword_end
|
14
|
+
; _buf << ("</span>\n".freeze); _buf = _buf.join
|
15
|
+
^
|
16
|
+
```
|
17
|
+
|
18
|
+
### Hamlit
|
19
|
+
```html
|
20
|
+
<span>
|
21
|
+
</span>
|
22
|
+
|
23
|
+
```
|
24
|
+
|
25
|
+
|
26
|
+
# [silent\_script\_spec.rb:90](/spec/hamlit/engine/silent_script_spec.rb#L90)
|
27
|
+
## Input
|
28
|
+
```haml
|
29
|
+
%span
|
30
|
+
- if false
|
31
|
+
ng
|
32
|
+
- else
|
33
|
+
|
34
|
+
```
|
35
|
+
|
36
|
+
## Output
|
37
|
+
### Faml
|
38
|
+
```html
|
39
|
+
SyntaxError: (eval):5: syntax error, unexpected end-of-input, expecting keyword_end
|
40
|
+
; _buf << ("</span>\n".freeze); _buf = _buf.join
|
41
|
+
^
|
42
|
+
```
|
43
|
+
|
44
|
+
### Hamlit
|
45
|
+
```html
|
46
|
+
<span>
|
47
|
+
</span>
|
48
|
+
|
49
|
+
```
|
50
|
+
|
51
|
+
|
52
|
+
# [silent\_script\_spec.rb:102](/spec/hamlit/engine/silent_script_spec.rb#L102)
|
53
|
+
## Input
|
54
|
+
```haml
|
55
|
+
%span
|
56
|
+
- case
|
57
|
+
- when false
|
58
|
+
|
59
|
+
```
|
60
|
+
|
61
|
+
## Output
|
62
|
+
### Faml
|
63
|
+
```html
|
64
|
+
SyntaxError: (eval):4: syntax error, unexpected end-of-input, expecting keyword_end
|
65
|
+
; _buf << ("</span>\n".freeze); _buf = _buf.join
|
66
|
+
^
|
67
|
+
```
|
68
|
+
|
69
|
+
### Hamlit
|
70
|
+
```html
|
71
|
+
<span>
|
72
|
+
</span>
|
73
|
+
|
74
|
+
```
|
75
|
+
|
76
|
+
|
77
|
+
# [silent\_script\_spec.rb:190](/spec/hamlit/engine/silent_script_spec.rb#L190)
|
78
|
+
## Input
|
79
|
+
```haml
|
80
|
+
- foo = [',
|
81
|
+
']
|
82
|
+
= foo
|
83
|
+
```
|
84
|
+
|
85
|
+
## Output
|
86
|
+
### Faml
|
87
|
+
```html
|
88
|
+
[",\n "]
|
89
|
+
|
90
|
+
```
|
91
|
+
|
92
|
+
### Hamlit
|
93
|
+
```html
|
94
|
+
[", "]
|
95
|
+
|
96
|
+
```
|
97
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# [text\_spec.rb:15](/spec/hamlit/engine/text_spec.rb#L15)
|
2
|
+
## Input
|
3
|
+
```haml
|
4
|
+
.
|
5
|
+
.*
|
6
|
+
..
|
7
|
+
#
|
8
|
+
#+
|
9
|
+
##
|
10
|
+
|
11
|
+
```
|
12
|
+
|
13
|
+
## Output
|
14
|
+
### Faml
|
15
|
+
```html
|
16
|
+
<div></div>
|
17
|
+
<div>*</div>
|
18
|
+
<div></div>
|
19
|
+
<div></div>
|
20
|
+
<div>+</div>
|
21
|
+
<div></div>
|
22
|
+
|
23
|
+
```
|
24
|
+
|
25
|
+
### Hamlit
|
26
|
+
```html
|
27
|
+
.
|
28
|
+
.*
|
29
|
+
..
|
30
|
+
#
|
31
|
+
#+
|
32
|
+
##
|
33
|
+
|
34
|
+
```
|
35
|
+
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# [coffee\_spec.rb:3](/spec/hamlit/filters/coffee_spec.rb#L3)
|
2
|
+
## Input
|
3
|
+
```haml
|
4
|
+
:coffee
|
5
|
+
foo = ->
|
6
|
+
alert('hello')
|
7
|
+
|
8
|
+
```
|
9
|
+
|
10
|
+
## Output
|
11
|
+
### Faml
|
12
|
+
```html
|
13
|
+
<script>
|
14
|
+
(function() {
|
15
|
+
var foo;
|
16
|
+
|
17
|
+
foo = function() {
|
18
|
+
return alert('hello');
|
19
|
+
};
|
20
|
+
|
21
|
+
}).call(this);
|
22
|
+
|
23
|
+
</script>
|
24
|
+
|
25
|
+
```
|
26
|
+
|
27
|
+
### Hamlit
|
28
|
+
```html
|
29
|
+
<script>
|
30
|
+
(function() {
|
31
|
+
var foo;
|
32
|
+
|
33
|
+
foo = function() {
|
34
|
+
return alert('hello');
|
35
|
+
};
|
36
|
+
|
37
|
+
}).call(this);
|
38
|
+
</script>
|
39
|
+
|
40
|
+
```
|
41
|
+
|
42
|
+
|
43
|
+
# [coffee\_spec.rb:22](/spec/hamlit/filters/coffee_spec.rb#L22)
|
44
|
+
## Input
|
45
|
+
```haml
|
46
|
+
:coffee
|
47
|
+
foo = ->
|
48
|
+
alert('hello')
|
49
|
+
|
50
|
+
```
|
51
|
+
|
52
|
+
## Output
|
53
|
+
### Faml
|
54
|
+
```html
|
55
|
+
<script>
|
56
|
+
(function() {
|
57
|
+
var foo;
|
58
|
+
|
59
|
+
foo = function() {
|
60
|
+
return alert('hello');
|
61
|
+
};
|
62
|
+
|
63
|
+
}).call(this);
|
64
|
+
|
65
|
+
</script>
|
66
|
+
|
67
|
+
```
|
68
|
+
|
69
|
+
### Hamlit
|
70
|
+
```html
|
71
|
+
<script>
|
72
|
+
(function() {
|
73
|
+
var foo;
|
74
|
+
|
75
|
+
foo = function() {
|
76
|
+
return alert('hello');
|
77
|
+
};
|
78
|
+
|
79
|
+
}).call(this);
|
80
|
+
</script>
|
81
|
+
|
82
|
+
```
|
83
|
+
|
84
|
+
|
85
|
+
# [coffee\_spec.rb:41](/spec/hamlit/filters/coffee_spec.rb#L41)
|
86
|
+
## Input
|
87
|
+
```haml
|
88
|
+
:coffee
|
89
|
+
foo = ->
|
90
|
+
alert("#{'<&>'}")
|
91
|
+
|
92
|
+
```
|
93
|
+
|
94
|
+
## Output
|
95
|
+
### Faml
|
96
|
+
```html
|
97
|
+
<script>
|
98
|
+
(function() {
|
99
|
+
var foo;
|
100
|
+
|
101
|
+
foo = function() {
|
102
|
+
return alert("<&>");
|
103
|
+
};
|
104
|
+
|
105
|
+
}).call(this);
|
106
|
+
|
107
|
+
</script>
|
108
|
+
|
109
|
+
```
|
110
|
+
|
111
|
+
### Hamlit
|
112
|
+
```html
|
113
|
+
<script>
|
114
|
+
(function() {
|
115
|
+
var foo;
|
116
|
+
|
117
|
+
foo = function() {
|
118
|
+
return alert("<&>");
|
119
|
+
};
|
120
|
+
|
121
|
+
}).call(this);
|
122
|
+
</script>
|
123
|
+
|
124
|
+
```
|
125
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# [erb\_spec.rb:3](/spec/hamlit/filters/erb_spec.rb#L3)
|
2
|
+
## Input
|
3
|
+
```haml
|
4
|
+
:erb
|
5
|
+
<% if true %>
|
6
|
+
ok
|
7
|
+
<% else %>
|
8
|
+
ng
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
```
|
12
|
+
|
13
|
+
## Output
|
14
|
+
### Faml
|
15
|
+
```html
|
16
|
+
Faml::FilterCompilers::NotFound: Unable to find compiler for erb
|
17
|
+
```
|
18
|
+
|
19
|
+
### Hamlit
|
20
|
+
```html
|
21
|
+
ok
|
22
|
+
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# [javascript\_spec.rb:3](/spec/hamlit/filters/javascript_spec.rb#L3)
|
2
|
+
## Input
|
3
|
+
```haml
|
4
|
+
before
|
5
|
+
:javascript
|
6
|
+
after
|
7
|
+
|
8
|
+
```
|
9
|
+
|
10
|
+
## Output
|
11
|
+
### Faml
|
12
|
+
```html
|
13
|
+
before
|
14
|
+
after
|
15
|
+
|
16
|
+
```
|
17
|
+
|
18
|
+
### Hamlit
|
19
|
+
```html
|
20
|
+
before
|
21
|
+
<script>
|
22
|
+
|
23
|
+
</script>
|
24
|
+
after
|
25
|
+
|
26
|
+
```
|
27
|
+
|