hamlit 1.5.7 → 1.5.8
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 +4 -0
- data/lib/hamlit/parsers/tag.rb +1 -3
- data/lib/hamlit/version.rb +1 -1
- data/spec/rails/app/views/users/inline.html.haml +6 -0
- data/spec/rails/config/routes.rb +1 -0
- data/spec/rails/spec/hamlit_spec.rb +8 -0
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3292ded147aeb720738b722d3ae053e58b50ba1d
|
4
|
+
data.tar.gz: ccc5a8f8dd78f16325c7da108946125f927708df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5e7fc75dd1d78f68283c6f2bc0f48107284320528ecd087e20dc3e2d2ec5c2c3942642818cb3e477b18c76f455a08bc12668b44a70ea36943df216af83c23aa
|
7
|
+
data.tar.gz: 914adab630716407fc272b775f19af94e2245f3cba68881c9abe363ed2c7813ba3388917331c8a4b93dd825d3f5442364c46961871009455294e9ab05fea0d19
|
data/CHANGELOG.md
CHANGED
data/lib/hamlit/parsers/tag.rb
CHANGED
@@ -25,9 +25,7 @@ module Hamlit
|
|
25
25
|
ast = [:html, :tag, tag, attrs]
|
26
26
|
inner_removal = parse_whitespace_removal(scanner)
|
27
27
|
|
28
|
-
if scanner.match?(
|
29
|
-
return ast << parse_script(scanner)
|
30
|
-
elsif !has_block?
|
28
|
+
if !has_block? || scanner.match?(/=|&=|!=/)
|
31
29
|
return ast if scanner.scan(/\//)
|
32
30
|
return ast << parse_line(scanner, inline: true)
|
33
31
|
end
|
data/lib/hamlit/version.rb
CHANGED
data/spec/rails/config/routes.rb
CHANGED
@@ -33,6 +33,14 @@ describe 'Hamlit rails integration', type: :request do
|
|
33
33
|
expect(response.body).to include("<a data-value='[{:count=>1}]'></a>")
|
34
34
|
end
|
35
35
|
|
36
|
+
it 'renders multi-line script inside a tag' do
|
37
|
+
get inline_users_path
|
38
|
+
expect(response.body).to include('<span><a data-url="2" href="#">1</a></span>')
|
39
|
+
expect(response.body).to include('<span><a data-url="4" href="#">3</a></span>')
|
40
|
+
expect(response.body).to include('<span><a data-url="6" href="#">5</a></span>')
|
41
|
+
expect(response.body).to include('<span><a data-url="6" href="#">5</a></span>')
|
42
|
+
end
|
43
|
+
|
36
44
|
describe 'escaping' do
|
37
45
|
it 'escapes script' do
|
38
46
|
get users_path(q: '<script>alert("a");</script>')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
@@ -413,6 +413,7 @@ files:
|
|
413
413
|
- spec/rails/app/views/users/form.html.haml
|
414
414
|
- spec/rails/app/views/users/helpers.html.haml
|
415
415
|
- spec/rails/app/views/users/index.html.haml
|
416
|
+
- spec/rails/app/views/users/inline.html.haml
|
416
417
|
- spec/rails/app/views/users/old_attributes.html.haml
|
417
418
|
- spec/rails/app/views/users/safe_buffer.html.haml
|
418
419
|
- spec/rails/app/views/users/whitespace.html.haml
|
@@ -528,6 +529,7 @@ test_files:
|
|
528
529
|
- spec/rails/app/views/users/form.html.haml
|
529
530
|
- spec/rails/app/views/users/helpers.html.haml
|
530
531
|
- spec/rails/app/views/users/index.html.haml
|
532
|
+
- spec/rails/app/views/users/inline.html.haml
|
531
533
|
- spec/rails/app/views/users/old_attributes.html.haml
|
532
534
|
- spec/rails/app/views/users/safe_buffer.html.haml
|
533
535
|
- spec/rails/app/views/users/whitespace.html.haml
|
@@ -571,3 +573,4 @@ test_files:
|
|
571
573
|
- spec/rails/vendor/assets/javascripts/.keep
|
572
574
|
- spec/rails/vendor/assets/stylesheets/.keep
|
573
575
|
- spec/spec_helper.rb
|
576
|
+
has_rdoc:
|