hamlit 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2a83cb9f5876957f819ff865a43be7ce1eb7c22
4
- data.tar.gz: 482c96d3f4d086cfd8b730cde51ea00b9f07149a
3
+ metadata.gz: f17fccee0547b3167279c8273055849258c7260d
4
+ data.tar.gz: 5af28ebd2215a7c46071937e0deb80ae160b1eab
5
5
  SHA512:
6
- metadata.gz: 3b84f182a19e5625d68b3731e7720978464232e9e6034806c156c3ef35b3a66840722615e311e9c16ef0b26bfb24efe84e35c375323e81889d866a0b5d93bae9
7
- data.tar.gz: fbe95e02dfed0e1c7f54341aaad968811fefd9cedc7c295cc20a7643a4f2cd22ddbc993e4a2cfbecd0a3f58653bf9e485fc02d1ba96442dfce88adbad0c7e15f
6
+ metadata.gz: e9d03161eaf316804f4f036f47adb97ef18f187130ea638a573f8ebb06a4e5137a69f086ec5ce70f732295c448e96571e6db9f473832d615bf27d6e6119fc93c
7
+ data.tar.gz: fcf649a051f1aa761fdb6ed9fefdbca8658a34c7e4c74e5cbc8a72cd634dab8c9300f8c1eb88126e021836338ee3c9788f30f499262709653898211bc9f29088
@@ -128,7 +128,11 @@ module Hamlit
128
128
  splitted = []
129
129
  start_pos = 1
130
130
  columns.each do |end_pos|
131
- splitted << str[start_pos..(end_pos - 1)]
131
+ if str.ascii_only?
132
+ splitted << str[start_pos..(end_pos - 1)]
133
+ else
134
+ splitted << str.unpack("C*")[start_pos..(end_pos - 1)].pack("C*").force_encoding('utf-8')
135
+ end
132
136
  start_pos = end_pos + 1
133
137
  end
134
138
 
@@ -1,3 +1,3 @@
1
1
  module Hamlit
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -87,6 +87,14 @@ describe Hamlit::Engine do
87
87
  HTML
88
88
  end
89
89
 
90
+ it 'renders multi-byte chars as static attribute value' do
91
+ assert_render(<<-'HAML', <<-HTML)
92
+ %img{ alt: 'こんにちは' }
93
+ HAML
94
+ <img alt='こんにちは'>
95
+ HTML
96
+ end
97
+
90
98
  describe 'nested attributes' do
91
99
  it 'renders true attributes' do
92
100
  assert_render(<<-'HAML', <<-HTML)
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: 0.3.2
4
+ version: 0.3.3
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-03-31 00:00:00.000000000 Z
11
+ date: 2015-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: temple