inline_svg 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of inline_svg might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57995dd216d10c2510f21c3dd8c4901eddf3e3e3
4
- data.tar.gz: 8a7bde8b778843e483350f3d0ee26ddb8d6d624a
3
+ metadata.gz: 40177208f78422aa2e769bc64df2000d092a2adb
4
+ data.tar.gz: 75580ae0380f2888a6bbef173ce86bc85367637d
5
5
  SHA512:
6
- metadata.gz: ccfc12998a8e3e64a8a1a338905673259118aaa84c6d67cd0a94ed11d4372102838a92dd4fb7f3d7a0c7e4c1b4475d627df7feb1b84090816a0ffef1fa6b424c
7
- data.tar.gz: 90940b65ec989da35c2ccf3e25aaacd5d0cced3f175bb99ce55b6b5d091797a1e78d7c498011cd98427d31f10af54d12e635ed6ba55a983ef0f1529c2945cd74
6
+ metadata.gz: 7e566fcb2a17948b8208cabe2e8f85f220a4bde915e129cc062dc2c1894d996372d925b3cd1788d5319266fb95705fffa424a76b6017333e49649ecb51f93550
7
+ data.tar.gz: 17a41bb9a990012a8d9fec96a05a4ee4464fd2975dfc8275fa88b97a81edc280b47ce1816a92d592967c4e70638f549a9ccca8de6aafc22bbff9b13d97e720ce
@@ -5,6 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
  ## [Unreleased][unreleased]
6
6
  - Nothing
7
7
 
8
+ ## [1.2.3] - 2017-08-17
9
+ ### Fixed
10
+ - Handle UTF-8 characters in SVG documents
11
+ [#60](https://github.com/jamesmartin/inline_svg/pull/69)
12
+
8
13
  ## [1.2.2] - 2017-07-06
9
14
  ### Fixed
10
15
  - Handle malformed documents that don't contain a root SVG element
@@ -167,7 +172,8 @@ transformations](https://github.com/jamesmartin/inline_svg/blob/master/README.md
167
172
  ### Added
168
173
  - Basic Railtie and view helper to inline SVG documents to Rails views.
169
174
 
170
- [unreleased]: https://github.com/jamesmartin/inline_svg/compare/v1.2.2...HEAD
175
+ [unreleased]: https://github.com/jamesmartin/inline_svg/compare/v1.2.3...HEAD
176
+ [1.2.3]: https://github.com/jamesmartin/inline_svg/compare/v1.2.1...v1.2.3
171
177
  [1.2.2]: https://github.com/jamesmartin/inline_svg/compare/v1.2.1...v1.2.2
172
178
  [1.2.1]: https://github.com/jamesmartin/inline_svg/compare/v1.2.0...v1.2.1
173
179
  [1.2.0]: https://github.com/jamesmartin/inline_svg/compare/v1.1.0...v1.2.0
@@ -19,7 +19,9 @@ module InlineSvg::TransformPipeline::Transformations
19
19
  #
20
20
  # Returns a Nokogiri::XML::Document.
21
21
  def with_svg(doc)
22
- doc = Nokogiri::XML::Document.parse(doc.to_html)
22
+ doc = Nokogiri::XML::Document.parse(
23
+ doc.to_html(encoding: "UTF-8"), nil, "UTF-8"
24
+ )
23
25
  svg = doc.at_css "svg"
24
26
  yield svg if svg && block_given?
25
27
  doc
@@ -1,3 +1,3 @@
1
1
  module InlineSvg
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
@@ -27,4 +27,13 @@ describe InlineSvg::TransformPipeline::Transformations::Title do
27
27
  "<svg><title>Some Title</title></svg>\n"
28
28
  )
29
29
  end
30
+
31
+ it "handles non-ASCII characters" do
32
+ document = Nokogiri::XML::Document.parse('<svg>Some document</svg>')
33
+ transformation = InlineSvg::TransformPipeline::Transformations::Title.create_with_value("åäö")
34
+
35
+ expect(transformation.transform(document).to_html).to eq(
36
+ "<svg><title>åäö</title>Some document</svg>\n"
37
+ )
38
+ end
30
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_svg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-06 00:00:00.000000000 Z
11
+ date: 2017-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler