hamlit 1.6.2 → 1.6.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: 3f85fe19ae942cdfef4ed10ea87a021b5603d915
4
- data.tar.gz: cec640d9203032acf294e118fa737724d89c0952
3
+ metadata.gz: 2fcdd736eed726e665a108fc41bad6d5525bedca
4
+ data.tar.gz: a6bd7ab15f0a06995eef5704105ea272288314e7
5
5
  SHA512:
6
- metadata.gz: c668671bcbea79462a605a52b934fa1ec86c81f2ba665abcdc5a1f1667a8b18548896f0069646a8318713d708a2cd241aa10dc28db0b03e4aa167110d679672a
7
- data.tar.gz: 5879b98703b9a549bee394304a1d34c3686c72a84bc7bb0b4d8da135e0674d3077e753009770da9a72d033ee3417970ef150200d1b362807b4c999c79025c628
6
+ metadata.gz: f2727bfa9938f2aa332f160bcf716b91f70a14b6a4f1562bc21a0a94f5ff23285aa9f033928149f6ffdfe91a1570073569d5d92422ab28830a2f0eafdf688a3c
7
+ data.tar.gz: f50b2affcf6a6a0b6150f7f6ac729aaeed8c8821126a5e654cf1f8220b7c7ec5e1989ee51e3da202feeb3415048645cd42d79257ac592014f086d7bbe5282836
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v1.6.3
2
+
3
+ - Fix ! and & parsing inside a tag
4
+ - https://github.com/k0kubun/hamlit/issues/27#issuecomment-111593458
5
+ - Thanks to @leesmith
6
+
1
7
  ## v1.6.2
2
8
 
3
9
  - Reject a content for self-closing tags
data/lib/hamlit/parser.rb CHANGED
@@ -71,9 +71,8 @@ module Hamlit
71
71
  return [:multi] if empty_line?(line)
72
72
 
73
73
  scanner = wrap_scanner(line)
74
- scanner.scan(/[ \t]+/)
75
-
76
74
  unless inline
75
+ scanner.scan(/[ \t]+/)
77
76
  ast = parse_outer_line(scanner)
78
77
  return ast if ast
79
78
  end
@@ -118,7 +117,7 @@ module Hamlit
118
117
  when '=', '~'
119
118
  parse_script(scanner)
120
119
  else
121
- parse_text(scanner)
120
+ parse_text(scanner, lstrip: true)
122
121
  end
123
122
  end
124
123
 
@@ -1,3 +1,3 @@
1
1
  module Hamlit
2
- VERSION = "1.6.2"
2
+ VERSION = "1.6.3"
3
3
  end
@@ -129,6 +129,24 @@ describe Hamlit::Engine do
129
129
  HTML
130
130
  end
131
131
 
132
+ it 'renders &, ! operator inside a tag' do
133
+ assert_render(<<-HAML, <<-HTML)
134
+ %span &nbsp;
135
+ %span&nbsp;
136
+ %span& nbsp;
137
+ %span !hello
138
+ %span!hello
139
+ %span! hello
140
+ HAML
141
+ <span>&nbsp;</span>
142
+ <span>nbsp;</span>
143
+ <span>nbsp;</span>
144
+ <span>!hello</span>
145
+ <span>hello</span>
146
+ <span>hello</span>
147
+ HTML
148
+ end
149
+
132
150
  it 'does not accept backslash operator' do
133
151
  assert_render(<<-'HAML', <<-'HTML')
134
152
  %span\ foo
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: 1.6.2
4
+ version: 1.6.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-06-11 00:00:00.000000000 Z
11
+ date: 2015-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: escape_utils