faml 0.2.3 → 0.2.4
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/faml/element_parser.rb +2 -2
- data/lib/faml/version.rb +1 -1
- data/spec/render/newline_spec.rb +5 -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: 328702b10e441bb1ae9badaa46916346ae4ce107
|
4
|
+
data.tar.gz: bb21f995e912c1730b63248d03ec0c53950edb0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61e63a2853364b69ffccdc59a1ceac429eba475a4a7cfa93c67a354a2cf74f75d66fa062a52b2a0f6dc7c0d09cf572663cf47772e5c8f91c9f584aebfee258ca
|
7
|
+
data.tar.gz: 47fffa94adedb8d3197076b5a1bf7ecef6a95a7e4a52606a710d7e08eb5f9959f9cb866df51d725a92001db941d2bdba5a6990fec056c76c8e9b46f3e6ea21b3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.2.4 (2015-03-26)
|
2
|
+
- Fix parser when parsing `>` or `<` after attribute lists
|
3
|
+
- `%div{foo: :bar} <br>` was incorrectly parsed as `%div{foo: :bar}< br>` .
|
4
|
+
|
1
5
|
## 0.2.3 (2015-03-25)
|
2
6
|
- Always escape texts in :escape filter
|
3
7
|
- It was not escaped when used in Rails
|
data/lib/faml/element_parser.rb
CHANGED
@@ -94,7 +94,7 @@ module Faml
|
|
94
94
|
depth = ParserUtils.balance(s, '{', '}', depth)
|
95
95
|
if depth == 0
|
96
96
|
attr = s.pre_match + s.matched
|
97
|
-
return [attr[1, attr.size-2], s.rest
|
97
|
+
return [attr[1, attr.size-2], s.rest]
|
98
98
|
else
|
99
99
|
if text[-1] == ',' && @line_parser.has_next?
|
100
100
|
text << @line_parser.next_line
|
@@ -117,7 +117,7 @@ module Faml
|
|
117
117
|
if depth == 0
|
118
118
|
t = s.string.byteslice(pre_pos ... s.pos-1)
|
119
119
|
new_attributes.concat(parse_new_attribute_list(t))
|
120
|
-
return [new_attributes, s.rest
|
120
|
+
return [new_attributes, s.rest]
|
121
121
|
else
|
122
122
|
if @line_parser.has_next?
|
123
123
|
text << ' ' << @line_parser.next_line
|
data/lib/faml/version.rb
CHANGED
data/spec/render/newline_spec.rb
CHANGED
@@ -67,6 +67,11 @@ HAML
|
|
67
67
|
= i
|
68
68
|
HAML
|
69
69
|
end
|
70
|
+
|
71
|
+
it 'parses texts correctly' do
|
72
|
+
expect(render_string('%div{foo: :bar} <b>hello</b>')).to eq("<div foo='bar'><b>hello</b></div>\n")
|
73
|
+
expect(render_string('%div(foo="bar") <b>hello</b>')).to eq("<div foo='bar'><b>hello</b></div>\n")
|
74
|
+
end
|
70
75
|
end
|
71
76
|
|
72
77
|
describe '><' do
|
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.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: escape_utils
|