faml 0.8.0 → 0.8.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edfe97f1920b0da9005f0e09220d9f3d393745ca
4
- data.tar.gz: 5dce79fe5a3e5c7b5e68a42d6e672fc05421c6ff
3
+ metadata.gz: 1d652850576bf5cf793a6874da846585cdf945c1
4
+ data.tar.gz: 2a5c5ae9dbc17ee19b60943ed74b2e1c98579bfe
5
5
  SHA512:
6
- metadata.gz: 1ceaa306c2e15b603aecb0d47d191705d14602025d1f5601f08c10361a59f0ba67b404dce3ff00346d2263aa845cfbabfcccaf45f74d65a7eca52229ac829031
7
- data.tar.gz: d119b8acd2a51a1a7f68deeb9afbf2ff1428d890fd8fde036cb5f0b52e52117b11eb27df8245ff9c1913bfc5bf7c7601835a92d04cf1a7450682ff4e107860e1
6
+ metadata.gz: ac04ddecd7219d7a82d382d2453f02f9217b3c93f63f23d2aa6bbc8768f707086dda9cdc3c8c77472d7b87e46b624c1a4945b76bd5aa48cf609bad5c38b522af
7
+ data.tar.gz: b0eb9b5903cd6270c5feba30fc60db06e1b070b654f527fb536a0667f8aa9eddc6d4b845e6471e9f0a5005b77234bc690fd3d1958a4e1b9cb8b6178b86a21d7a
data/Appraisals CHANGED
@@ -2,12 +2,14 @@ appraise 'rails-4.0' do
2
2
  gem 'rails', '~> 4.0.0'
3
3
  gem 'rspec-rails', '>= 3.2.0'
4
4
  gem 'sqlite3'
5
+ gem 'nokogiri'
5
6
  end
6
7
 
7
8
  appraise 'rails-4.1' do
8
9
  gem 'rails', '~> 4.1.0'
9
10
  gem 'rspec-rails', '>= 3.2.0'
10
11
  gem 'sqlite3'
12
+ gem 'nokogiri'
11
13
  end
12
14
 
13
15
  appraise 'rails-4.2' do
@@ -1,5 +1,10 @@
1
+ ## 0.8.1 (2016-02-28)
2
+ - Fix attribute escaping of html_safe string
3
+ - https://github.com/eagletmt/faml/issues/48
4
+
1
5
  ## 0.8.0 (2016-01-22)
2
6
  - Drop Ruby 2.0.0 support
7
+ - Ruby 2.0.0 is End of Life http://www.ruby-lang.org/en/news/2016/02/24/support-plan-of-ruby-2-0-0-and-2-1/
3
8
 
4
9
  ## 0.7.3 (2016-01-22)
5
10
  - Fix build error when `$CXXFLAGS` is unavailable
@@ -5,5 +5,6 @@ source "https://rubygems.org"
5
5
  gem "rails", "~> 4.0.0"
6
6
  gem "rspec-rails", ">= 3.2.0"
7
7
  gem "sqlite3"
8
+ gem "nokogiri"
8
9
 
9
10
  gemspec :path => "../"
@@ -5,5 +5,6 @@ source "https://rubygems.org"
5
5
  gem "rails", "~> 4.1.0"
6
6
  gem "rspec-rails", ">= 3.2.0"
7
7
  gem "sqlite3"
8
+ gem "nokogiri"
8
9
 
9
10
  gemspec :path => "../"
@@ -1,8 +1,8 @@
1
1
  # Incompatibilities
2
2
  ## Versions
3
3
  - Haml 4.1.0.beta.1
4
- - Faml 0.7.2
5
- - Hamlit 2.0.2
4
+ - Faml 0.8.1
5
+ - Hamlit 2.2.2
6
6
 
7
7
  ## Table of contents
8
8
  - [spec/compiler_newline_spec.md](spec/compiler_newline_spec.md)
@@ -51,7 +51,7 @@ abc
51
51
 
52
52
  ```
53
53
 
54
- ## Haml
54
+ ## Haml, Hamlit
55
55
  ```html
56
56
  <span>
57
57
  hello
@@ -64,15 +64,3 @@ abc
64
64
 
65
65
  ```
66
66
 
67
- ## Hamlit
68
- ```html
69
- <span>
70
- hello
71
-
72
- abc
73
-
74
- <span>world</span>
75
- </span>
76
-
77
- ```
78
-
@@ -33,7 +33,7 @@ module Faml
33
33
  ['false, nil', [:multi]],
34
34
  [:else, [:multi,
35
35
  [:static, " #{name}=#{options[:attr_quote]}"],
36
- [:escape, true, [:dynamic, sym]],
36
+ [:dynamic, "::Temple::Utils.escape_html(#{sym})"],
37
37
  [:static, options[:attr_quote]],
38
38
  ]],
39
39
  ],
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Faml
3
- VERSION = '0.8.0'.freeze
3
+ VERSION = '0.8.1'.freeze
4
4
  end
@@ -0,0 +1,2 @@
1
+ - html = %q{<b>"don't skip escape"</b>}.html_safe
2
+ %span{'data-html' => html}
@@ -6,6 +6,7 @@ Rails.application.routes.draw do
6
6
  get :with_capture
7
7
  get :escaped
8
8
  get :preserve
9
+ get :html_safe_attribute
9
10
 
10
11
  get :syntax_error
11
12
  get :indent_error
@@ -46,6 +46,13 @@ RSpec.describe 'Faml with Rails', type: :request do
46
46
  expect(response.body).to include('&lt;marquee&gt;escape me&lt;/marquee&gt;')
47
47
  end
48
48
 
49
+ it 'escapes html_safe string in attribute values' do
50
+ get '/books/html_safe_attribute'
51
+ expect(response).to be_ok
52
+ html = Nokogiri::HTML.parse(response.body)
53
+ expect(html.at_css('span')['data-html']).to eq(%q{<b>"don't skip escape"</b>})
54
+ end
55
+
49
56
  describe 'object reference' do
50
57
  it 'works with new object' do
51
58
  get '/books/object_ref'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kohei Suzuki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-22 00:00:00.000000000 Z
11
+ date: 2016-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: escape_utils
@@ -404,6 +404,7 @@ files:
404
404
  - spec/rails/app/views/books/filter_invalid_interpolation.html.haml
405
405
  - spec/rails/app/views/books/filter_not_found.html.haml
406
406
  - spec/rails/app/views/books/hello.html.haml
407
+ - spec/rails/app/views/books/html_safe_attribute.html.haml
407
408
  - spec/rails/app/views/books/indent_error.html.haml
408
409
  - spec/rails/app/views/books/invalid_interpolation.html.haml
409
410
  - spec/rails/app/views/books/object_ref.html.haml
@@ -521,7 +522,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
521
522
  version: '0'
522
523
  requirements: []
523
524
  rubyforge_project:
524
- rubygems_version: 2.5.1
525
+ rubygems_version: 2.5.2
525
526
  signing_key:
526
527
  specification_version: 4
527
528
  summary: Faster implementation of Haml template language.
@@ -566,6 +567,7 @@ test_files:
566
567
  - spec/rails/app/views/books/filter_invalid_interpolation.html.haml
567
568
  - spec/rails/app/views/books/filter_not_found.html.haml
568
569
  - spec/rails/app/views/books/hello.html.haml
570
+ - spec/rails/app/views/books/html_safe_attribute.html.haml
569
571
  - spec/rails/app/views/books/indent_error.html.haml
570
572
  - spec/rails/app/views/books/invalid_interpolation.html.haml
571
573
  - spec/rails/app/views/books/object_ref.html.haml