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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/doc/README.md +15 -2
  4. data/doc/engine/indent.md +24 -0
  5. data/doc/engine/new_attribute.md +77 -0
  6. data/doc/engine/old_attributes.md +127 -0
  7. data/doc/engine/silent_script.md +97 -0
  8. data/doc/engine/tag.md +48 -0
  9. data/doc/engine/text.md +7 -1
  10. data/doc/faml/README.md +19 -0
  11. data/doc/faml/engine/indent.md +24 -0
  12. data/doc/faml/engine/old_attributes.md +108 -0
  13. data/doc/faml/engine/silent_script.md +97 -0
  14. data/doc/faml/engine/text.md +35 -0
  15. data/doc/faml/filters/coffee.md +125 -0
  16. data/doc/faml/filters/erb.md +24 -0
  17. data/doc/faml/filters/javascript.md +27 -0
  18. data/doc/faml/filters/less.md +57 -0
  19. data/doc/faml/filters/plain.md +25 -0
  20. data/doc/faml/filters/sass.md +62 -0
  21. data/doc/faml/filters/scss.md +68 -0
  22. data/doc/haml/README.md +15 -0
  23. data/doc/haml/engine/new_attribute.md +77 -0
  24. data/doc/haml/engine/old_attributes.md +142 -0
  25. data/doc/haml/engine/tag.md +48 -0
  26. data/doc/haml/engine/text.md +59 -0
  27. data/doc/haml/filters/erb.md +26 -0
  28. data/doc/haml/filters/javascript.md +76 -0
  29. data/doc/haml/filters/markdown.md +31 -0
  30. data/lib/hamlit/compilers/attributes.rb +1 -1
  31. data/lib/hamlit/compilers/new_attribute.rb +6 -6
  32. data/lib/hamlit/compilers/old_attribute.rb +2 -2
  33. data/lib/hamlit/compilers/text.rb +7 -10
  34. data/lib/hamlit/concerns/lexable.rb +32 -0
  35. data/lib/hamlit/parser.rb +9 -8
  36. data/lib/hamlit/parsers/attribute.rb +6 -3
  37. data/lib/hamlit/version.rb +1 -1
  38. data/spec/hamlit/engine/indent_spec.rb +1 -1
  39. data/spec/hamlit/engine/new_attribute_spec.rb +13 -2
  40. data/spec/hamlit/engine/old_attributes_spec.rb +5 -5
  41. data/spec/hamlit/engine/silent_script_spec.rb +4 -4
  42. data/spec/hamlit/engine/tag_spec.rb +23 -0
  43. data/spec/hamlit/engine/text_spec.rb +7 -3
  44. data/spec/spec_helper.rb +7 -231
  45. data/spec/spec_helper/document_generator.rb +93 -0
  46. data/spec/spec_helper/render_helper.rb +112 -0
  47. data/spec/spec_helper/test_case.rb +55 -0
  48. metadata +33 -3
  49. data/lib/hamlit/concerns/ripperable.rb +0 -20
@@ -0,0 +1,57 @@
1
+ # [less\_spec.rb:3](/spec/hamlit/filters/less_spec.rb#L3)
2
+ ## Input
3
+ ```haml
4
+ :less
5
+ .users_controller {
6
+ .show_action {
7
+ margin: 10px;
8
+ padding: 20px;
9
+ }
10
+ }
11
+
12
+ ```
13
+
14
+ ## Output
15
+ ### Faml
16
+ ```html
17
+ Faml::FilterCompilers::NotFound: Unable to find compiler for less
18
+ ```
19
+
20
+ ### Hamlit
21
+ ```html
22
+ <style>
23
+ .users_controller .show_action {
24
+ margin: 10px;
25
+ padding: 20px;
26
+ }
27
+ </style>
28
+
29
+ ```
30
+
31
+
32
+ # [less\_spec.rb:22](/spec/hamlit/filters/less_spec.rb#L22)
33
+ ## Input
34
+ ```haml
35
+ :less
36
+ .foo {
37
+ content: "#{'<&>'}";
38
+ }
39
+
40
+ ```
41
+
42
+ ## Output
43
+ ### Faml
44
+ ```html
45
+ Faml::FilterCompilers::NotFound: Unable to find compiler for less
46
+ ```
47
+
48
+ ### Hamlit
49
+ ```html
50
+ <style>
51
+ .foo {
52
+ content: "<&>";
53
+ }
54
+ </style>
55
+
56
+ ```
57
+
@@ -0,0 +1,25 @@
1
+ # [plain\_spec.rb:3](/spec/hamlit/filters/plain_spec.rb#L3)
2
+ ## Input
3
+ ```haml
4
+ :plain
5
+
6
+ #{'い'}
7
+
8
+ ```
9
+
10
+ ## Output
11
+ ### Faml
12
+ ```html
13
+
14
+
15
+
16
+ ```
17
+
18
+ ### Hamlit
19
+ ```html
20
+
21
+
22
+
23
+
24
+ ```
25
+
@@ -0,0 +1,62 @@
1
+ # [sass\_spec.rb:3](/spec/hamlit/filters/sass_spec.rb#L3)
2
+ ## Input
3
+ ```haml
4
+ :sass
5
+ .users_controller
6
+ .show_action
7
+ margin: 10px
8
+ padding: 20px
9
+
10
+ ```
11
+
12
+ ## Output
13
+ ### Faml
14
+ ```html
15
+ <style>
16
+ .users_controller .show_action {
17
+ margin: 10px;
18
+ padding: 20px; }
19
+ </style>
20
+
21
+ ```
22
+
23
+ ### Hamlit
24
+ ```html
25
+ <style>
26
+ .users_controller .show_action {
27
+ margin: 10px;
28
+ padding: 20px; }
29
+ </style>
30
+
31
+ ```
32
+
33
+
34
+ # [sass\_spec.rb:19](/spec/hamlit/filters/sass_spec.rb#L19)
35
+ ## Input
36
+ ```haml
37
+ :sass
38
+ .users_controller
39
+ .show_action
40
+ content: "#{'<&>'}"
41
+
42
+ ```
43
+
44
+ ## Output
45
+ ### Faml
46
+ ```html
47
+ <style>
48
+ .users_controller .show_action {
49
+ content: "<&>"; }
50
+ </style>
51
+
52
+ ```
53
+
54
+ ### Hamlit
55
+ ```html
56
+ <style>
57
+ .users_controller .show_action {
58
+ content: "<&>"; }
59
+ </style>
60
+
61
+ ```
62
+
@@ -0,0 +1,68 @@
1
+ # [scss\_spec.rb:3](/spec/hamlit/filters/scss_spec.rb#L3)
2
+ ## Input
3
+ ```haml
4
+ :scss
5
+ .users_controller {
6
+ .show_action {
7
+ margin: 10px;
8
+ padding: 20px;
9
+ }
10
+ }
11
+
12
+ ```
13
+
14
+ ## Output
15
+ ### Faml
16
+ ```html
17
+ <style>
18
+ .users_controller .show_action {
19
+ margin: 10px;
20
+ padding: 20px; }
21
+
22
+ </style>
23
+
24
+ ```
25
+
26
+ ### Hamlit
27
+ ```html
28
+ <style>
29
+ .users_controller .show_action {
30
+ margin: 10px;
31
+ padding: 20px; }
32
+ </style>
33
+
34
+ ```
35
+
36
+
37
+ # [scss\_spec.rb:21](/spec/hamlit/filters/scss_spec.rb#L21)
38
+ ## Input
39
+ ```haml
40
+ :scss
41
+ .users_controller {
42
+ .show_action {
43
+ content: "#{'<&>'}";
44
+ }
45
+ }
46
+
47
+ ```
48
+
49
+ ## Output
50
+ ### Faml
51
+ ```html
52
+ <style>
53
+ .users_controller .show_action {
54
+ content: "<&>"; }
55
+
56
+ </style>
57
+
58
+ ```
59
+
60
+ ### Hamlit
61
+ ```html
62
+ <style>
63
+ .users_controller .show_action {
64
+ content: "<&>"; }
65
+ </style>
66
+
67
+ ```
68
+
@@ -0,0 +1,15 @@
1
+ # Hamlit incompatibilities
2
+ This is a document generated from RSpec test cases.
3
+ Showing incompatibilities against [Haml](https://github.com/haml/haml).
4
+
5
+ ## engine
6
+ - [engine/new\_attribute\_spec.rb](engine/new_attribute.md)
7
+ - [engine/old\_attributes\_spec.rb](engine/old_attributes.md)
8
+ - [engine/tag\_spec.rb](engine/tag.md)
9
+ - [engine/text\_spec.rb](engine/text.md)
10
+
11
+
12
+ ## filters
13
+ - [filters/erb\_spec.rb](filters/erb.md)
14
+ - [filters/javascript\_spec.rb](filters/javascript.md)
15
+ - [filters/markdown\_spec.rb](filters/markdown.md)
@@ -0,0 +1,77 @@
1
+ # [new\_attribute\_spec.rb:19](/spec/hamlit/engine/new_attribute_spec.rb#L19)
2
+ ## Input
3
+ ```haml
4
+ %span(a=__LINE__
5
+ b=__LINE__)
6
+ = __LINE__
7
+
8
+ ```
9
+
10
+ ## Output
11
+ ### Haml
12
+ ```html
13
+ <span a='1' b='1'></span>
14
+ 3
15
+
16
+ ```
17
+
18
+ ### Hamlit
19
+ ```html
20
+ <span a='1' b='2'></span>
21
+ 3
22
+
23
+ ```
24
+
25
+
26
+ # [new\_attribute\_spec.rb:31](/spec/hamlit/engine/new_attribute_spec.rb#L31)
27
+ ## Input
28
+ ```haml
29
+ %a(title="'")
30
+ %a(title = "'\"")
31
+ %a(href='/search?foo=bar&hoge=<fuga>')
32
+
33
+ ```
34
+
35
+ ## Output
36
+ ### Haml
37
+ ```html
38
+ <a title="'"></a>
39
+ <a title='&#x0027;"'></a>
40
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
41
+
42
+ ```
43
+
44
+ ### Hamlit
45
+ ```html
46
+ <a title='&#39;'></a>
47
+ <a title='&#39;&quot;'></a>
48
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
49
+
50
+ ```
51
+
52
+
53
+ # [new\_attribute\_spec.rb:43](/spec/hamlit/engine/new_attribute_spec.rb#L43)
54
+ ## Input
55
+ ```haml
56
+ - title = "'\""
57
+ - href = '/search?foo=bar&hoge=<fuga>'
58
+ %a(title=title)
59
+ %a(href=href)
60
+
61
+ ```
62
+
63
+ ## Output
64
+ ### Haml
65
+ ```html
66
+ <a title='&#x0027;"'></a>
67
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
68
+
69
+ ```
70
+
71
+ ### Hamlit
72
+ ```html
73
+ <a title='&#39;&quot;'></a>
74
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
75
+
76
+ ```
77
+
@@ -0,0 +1,142 @@
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
+ ### Haml
10
+ ```html
11
+ Haml::SyntaxError: (haml):1: syntax error, unexpected tSTRING_DEND, expecting ')'
12
+ ...l, class: ')}>}}', id: '{}}' } }{</span>\n";;_erbout
13
+ ... ^
14
+ (haml):1: unterminated regexp meets end of file
15
+ ```
16
+
17
+ ### Hamlit
18
+ ```html
19
+ <span class='}}}' id='{}}'>}{</span>
20
+
21
+ ```
22
+
23
+
24
+ # [old\_attributes\_spec.rb:201](/spec/hamlit/engine/old_attributes_spec.rb#L201)
25
+ ## Input
26
+ ```haml
27
+ / wontfix: Non-boolean attributes are not escaped for optimization.
28
+ - val = false
29
+ %a{ href: val }
30
+ - val = nil
31
+ %a{ href: val }
32
+
33
+ / Boolean attributes are escaped correctly.
34
+ - val = false
35
+ %a{ disabled: val }
36
+ - val = nil
37
+ %a{ disabled: val }
38
+
39
+ ```
40
+
41
+ ## Output
42
+ ### Haml
43
+ ```html
44
+ <!-- wontfix: Non-boolean attributes are not escaped for optimization. -->
45
+ <a></a>
46
+ <a></a>
47
+ <!-- Boolean attributes are escaped correctly. -->
48
+ <a></a>
49
+ <a></a>
50
+
51
+ ```
52
+
53
+ ### Hamlit
54
+ ```html
55
+ <!-- wontfix: Non-boolean attributes are not escaped for optimization. -->
56
+ <a href='false'></a>
57
+ <a href=''></a>
58
+ <!-- Boolean attributes are escaped correctly. -->
59
+ <a></a>
60
+ <a></a>
61
+
62
+ ```
63
+
64
+
65
+ # [old\_attributes\_spec.rb:226](/spec/hamlit/engine/old_attributes_spec.rb#L226)
66
+ ## Input
67
+ ```haml
68
+ %a{title: "'"}
69
+ %a{title: "'\""}
70
+ %a{href: '/search?foo=bar&hoge=<fuga>'}
71
+
72
+ ```
73
+
74
+ ## Output
75
+ ### Haml
76
+ ```html
77
+ <a title="'"></a>
78
+ <a title='&#x0027;"'></a>
79
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
80
+
81
+ ```
82
+
83
+ ### Hamlit
84
+ ```html
85
+ <a title='&#39;'></a>
86
+ <a title='&#39;&quot;'></a>
87
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
88
+
89
+ ```
90
+
91
+
92
+ # [old\_attributes\_spec.rb:238](/spec/hamlit/engine/old_attributes_spec.rb#L238)
93
+ ## Input
94
+ ```haml
95
+ - title = "'\""
96
+ - href = '/search?foo=bar&hoge=<fuga>'
97
+ %a{title: title}
98
+ %a{href: href}
99
+
100
+ ```
101
+
102
+ ## Output
103
+ ### Haml
104
+ ```html
105
+ <a title='&#x0027;"'></a>
106
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
107
+
108
+ ```
109
+
110
+ ### Hamlit
111
+ ```html
112
+ <a title='&#39;&quot;'></a>
113
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
114
+
115
+ ```
116
+
117
+
118
+ # [old\_attributes\_spec.rb:250](/spec/hamlit/engine/old_attributes_spec.rb#L250)
119
+ ## Input
120
+ ```haml
121
+ - title = { title: "'\"" }
122
+ - href = { href: '/search?foo=bar&hoge=<fuga>' }
123
+ %a{ title }
124
+ %a{ href }
125
+
126
+ ```
127
+
128
+ ## Output
129
+ ### Haml
130
+ ```html
131
+ <a title='&#x0027;"'></a>
132
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
133
+
134
+ ```
135
+
136
+ ### Hamlit
137
+ ```html
138
+ <a title='&#39;&quot;'></a>
139
+ <a href='/search?foo=bar&amp;hoge=&lt;fuga&gt;'></a>
140
+
141
+ ```
142
+