hamlit 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/hamlit/filters/css.rb +1 -1
- data/lib/hamlit/filters/javascript.rb +1 -1
- data/lib/hamlit/version.rb +1 -1
- data/spec/hamlit/filters/coffee_spec.rb +19 -0
- data/spec/hamlit/filters/css_spec.rb +2 -2
- data/spec/hamlit/filters/javascript_spec.rb +2 -2
- data/spec/hamlit/filters/less_spec.rb +15 -0
- data/spec/hamlit/filters/markdown_spec.rb +5 -3
- data/spec/hamlit/filters/ruby_spec.rb +3 -3
- data/spec/hamlit/filters/sass_spec.rb +2 -6
- data/spec/hamlit/filters/scss_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79bcf89bde702278c1bdad3ee833aec2e94eb58a
|
4
|
+
data.tar.gz: d58885a682edc39e69a4027c4e0834f5d679a9e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44fd92f92e8752ed72e56e0d46a5eae2ee69aa12175476f7fa39c8423c86a730522a471b9d9664d2f2ec43cf59108951c284209cae49b24255a134ed9962d7ba
|
7
|
+
data.tar.gz: 6f20ddab502046ca46ab6fe61d8c04a8655f72ed917e1e51470ed2e26715491269100ba3c3125482a2215800ac919325e2c96c38cc50dba32e7d52e524c4a0f5
|
data/CHANGELOG.md
CHANGED
data/lib/hamlit/filters/css.rb
CHANGED
@@ -12,7 +12,7 @@ module Hamlit
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def compile_html(lines)
|
15
|
-
ast = [:haml, :text, compile_lines(lines, indent_width: 2)]
|
15
|
+
ast = [:haml, :text, compile_lines(lines, indent_width: 2), false]
|
16
16
|
ast = [:multi, [:static, "\n"], ast]
|
17
17
|
ast = [:html, :tag, 'style', [:html, :attrs], ast]
|
18
18
|
ast
|
@@ -12,7 +12,7 @@ module Hamlit
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def compile_html(lines)
|
15
|
-
ast = [:haml, :text, compile_lines(lines, indent_width: 2)]
|
15
|
+
ast = [:haml, :text, compile_lines(lines, indent_width: 2), false]
|
16
16
|
ast = [:multi, [:static, "\n"], ast]
|
17
17
|
ast = [:html, :tag, 'script', [:html, :attrs], ast]
|
18
18
|
ast
|
data/lib/hamlit/version.rb
CHANGED
@@ -37,5 +37,24 @@ describe Hamlit::Filters::Coffee do
|
|
37
37
|
</script>
|
38
38
|
HTML
|
39
39
|
end
|
40
|
+
|
41
|
+
it 'renders coffeescript filter' do
|
42
|
+
assert_render(<<-'HAML', <<-HTML)
|
43
|
+
:coffee
|
44
|
+
foo = ->
|
45
|
+
alert("#{'<&>'}")
|
46
|
+
HAML
|
47
|
+
<script>
|
48
|
+
(function() {
|
49
|
+
var foo;
|
50
|
+
|
51
|
+
foo = function() {
|
52
|
+
return alert("<&>");
|
53
|
+
};
|
54
|
+
|
55
|
+
}).call(this);
|
56
|
+
</script>
|
57
|
+
HTML
|
58
|
+
end
|
40
59
|
end
|
41
60
|
end
|
@@ -71,10 +71,10 @@ describe Hamlit::Filters::Javascript do
|
|
71
71
|
it 'parses string interpolation' do
|
72
72
|
assert_render(<<-'HAML', <<-HTML)
|
73
73
|
:javascript
|
74
|
-
var a = #{
|
74
|
+
var a = "#{'<&>'}";
|
75
75
|
HAML
|
76
76
|
<script>
|
77
|
-
var a =
|
77
|
+
var a = "<&>";
|
78
78
|
</script>
|
79
79
|
HTML
|
80
80
|
end
|
@@ -18,5 +18,20 @@ describe Hamlit::Filters::Less do
|
|
18
18
|
</style>
|
19
19
|
HTML
|
20
20
|
end
|
21
|
+
|
22
|
+
it 'parses string interpolation' do
|
23
|
+
assert_render(<<-'HAML', <<-HTML)
|
24
|
+
:less
|
25
|
+
.foo {
|
26
|
+
content: "#{'<&>'}";
|
27
|
+
}
|
28
|
+
HAML
|
29
|
+
<style>
|
30
|
+
.foo {
|
31
|
+
content: "<&>";
|
32
|
+
}
|
33
|
+
</style>
|
34
|
+
HTML
|
35
|
+
end
|
21
36
|
end
|
22
37
|
end
|
@@ -14,14 +14,16 @@ describe Hamlit::Filters::Markdown do
|
|
14
14
|
|
15
15
|
it 'renders markdown filter with string interpolation' do
|
16
16
|
assert_render(<<-'HAML', <<-HTML)
|
17
|
-
- project = 'Hamlit'
|
17
|
+
- project = '<Hamlit>'
|
18
18
|
:markdown
|
19
19
|
# #{project}
|
20
|
+
#{'<&>'}
|
20
21
|
Yet another haml implementation
|
21
22
|
HAML
|
22
|
-
<h1
|
23
|
+
<h1><Hamlit></h1>
|
23
24
|
|
24
|
-
<p
|
25
|
+
<p><&>
|
26
|
+
Yet another haml implementation</p>
|
25
27
|
HTML
|
26
28
|
end
|
27
29
|
end
|
@@ -11,14 +11,14 @@ describe Hamlit::Filters::Ruby do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'renders ruby filter' do
|
14
|
-
assert_render(<<-HAML, <<-HTML)
|
14
|
+
assert_render(<<-'HAML', <<-HTML)
|
15
15
|
:ruby
|
16
16
|
hash = {
|
17
|
-
a:
|
17
|
+
a: "#{'<&>'}",
|
18
18
|
}
|
19
19
|
= hash[:a]
|
20
20
|
HAML
|
21
|
-
|
21
|
+
<&>
|
22
22
|
HTML
|
23
23
|
end
|
24
24
|
end
|
@@ -18,18 +18,14 @@ describe Hamlit::Filters::Sass do
|
|
18
18
|
|
19
19
|
it 'renders sass filter with string interpolation' do
|
20
20
|
assert_render(<<-'HAML', <<-HTML)
|
21
|
-
- width = 1200
|
22
|
-
- height = 800
|
23
21
|
:sass
|
24
22
|
.users_controller
|
25
23
|
.show_action
|
26
|
-
|
27
|
-
height: #{height}px
|
24
|
+
content: "#{'<&>'}"
|
28
25
|
HAML
|
29
26
|
<style>
|
30
27
|
.users_controller .show_action {
|
31
|
-
|
32
|
-
height: 800px; }
|
28
|
+
content: "<&>"; }
|
33
29
|
</style>
|
34
30
|
HTML
|
35
31
|
end
|
@@ -17,5 +17,21 @@ describe Hamlit::Filters::Scss do
|
|
17
17
|
</style>
|
18
18
|
HTML
|
19
19
|
end
|
20
|
+
|
21
|
+
it 'parses string interpolation' do
|
22
|
+
assert_render(<<-'HAML', <<-HTML)
|
23
|
+
:scss
|
24
|
+
.users_controller {
|
25
|
+
.show_action {
|
26
|
+
content: "#{'<&>'}";
|
27
|
+
}
|
28
|
+
}
|
29
|
+
HAML
|
30
|
+
<style>
|
31
|
+
.users_controller .show_action {
|
32
|
+
content: "<&>"; }
|
33
|
+
</style>
|
34
|
+
HTML
|
35
|
+
end
|
20
36
|
end
|
21
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamlit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: escape_utils
|