hamlit 1.3.0 → 1.3.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: 89250564d274169193ab2b990498777705b31cf9
4
- data.tar.gz: 154fd04373a7b7d574cb203187bd4c7f21172ab2
3
+ metadata.gz: e92ff1c813c38898530572a8177c675b49528e93
4
+ data.tar.gz: ff2ccf1d3641092df0931b00d708e15a97ef24a2
5
5
  SHA512:
6
- metadata.gz: 92799f8c4f1bea17c85e5e2911c9430f2193226c3a835deb77acd348b21240eb5bb837351760ae1eeb426312bda7bf8e9c574bd89c7c25585c4dcc9635646a39
7
- data.tar.gz: b0381cb98e2987dff4574e707a181bfc97d5261b1e3e071d9f336f2914ab89df2d5a0cf681a94c43d6a5b8b6fe5f467338d0119459db6e3ab5ffdc1e7a59d1e8
6
+ metadata.gz: 6d8d4fb3f7fa9fb4a8fc02318a77264220160faeda20cd44e242d9446093a4bcd7189426a4ae58ad243605459678843007da1889758f254ef07eda1ac021e8fa
7
+ data.tar.gz: 4c9d9a025c178443fb21080be6695f65f8691c76987e5d2fd028fde8921e6572b821dc500a7b1de1d4fa57929d6f12844fe0d6841e8adfac5b33bf0e0ecef9c0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v1.3.1
2
+
3
+ - Bugfix about a backslash-only comment
4
+ - Don't strip a plain text
5
+
1
6
  ## v1.3.0
2
7
 
3
8
  - Resurrect escape_html option
@@ -29,6 +29,7 @@ module Hamlit
29
29
  elsif scanner.scan(/\//)
30
30
  return ast
31
31
  elsif scanner.rest.match(/[^ ]/)
32
+ scanner.scan(/ +/)
32
33
  ast << parse_text(scanner)
33
34
  return ast
34
35
  elsif next_indent <= @current_indent
@@ -3,7 +3,7 @@ module Hamlit
3
3
  module Text
4
4
  def parse_text(scanner)
5
5
  ast = [:haml, :text]
6
- ast << scanner.scan(/.+/).strip
6
+ ast << (scanner.scan(/.+/) || '')
7
7
  ast
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Hamlit
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -14,6 +14,33 @@ describe Hamlit::Parser do
14
14
  HTML
15
15
  end
16
16
 
17
+ it 'accepts backslash-only line in a comment' do
18
+ assert_render(<<-'HAML', <<-HTML)
19
+ /
20
+ \
21
+ HAML
22
+ <!--
23
+
24
+ -->
25
+ HTML
26
+ end
27
+
28
+ it 'renders a deeply indented comment starting with backslash' do
29
+ assert_render(<<-'HAML', <<-HTML)
30
+ /
31
+ \ a
32
+ /
33
+ a
34
+ HAML
35
+ <!--
36
+ a
37
+ -->
38
+ <!--
39
+ a
40
+ -->
41
+ HTML
42
+ end
43
+
17
44
  it 'ignores multiline comment' do
18
45
  assert_render(<<-'HAML', <<-HTML)
19
46
  -# if true
@@ -38,5 +38,9 @@ describe Hamlit::Engine do
38
38
  -
39
39
  HTML
40
40
  end
41
+
42
+ it 'leaves empty spaces after backslash' do
43
+ expect(render_string('\ a')).to eq(" a\n")
44
+ end
41
45
  end
42
46
  end
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.3.0
4
+ version: 1.3.1
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-05-16 00:00:00.000000000 Z
11
+ date: 2015-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: escape_utils
@@ -569,3 +569,4 @@ test_files:
569
569
  - spec/rails/vendor/assets/javascripts/.keep
570
570
  - spec/rails/vendor/assets/stylesheets/.keep
571
571
  - spec/spec_helper.rb
572
+ has_rdoc: