hamlit 2.10.1-java → 2.11.0-java

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
  SHA256:
3
- metadata.gz: dcd64f41bc7d4f560924ac3f6bebbf158eb32f28ffecb5bd223bee0d4bb30ecc
4
- data.tar.gz: 1c655cc0ba0c580da4d44f8021382ec78bff5e8bef084b1c698d48c6f5616606
3
+ metadata.gz: fec8304753bc50c9a95858f662c6edb6e23738d9b4d872abfa842c6c9d0f0dbf
4
+ data.tar.gz: 8094817a2939477cb4bf54ffd90d0c544c9b76e9035ab6e25f7ea0464006badc
5
5
  SHA512:
6
- metadata.gz: 88d572b4d2fae502c81ff4ab14b9313ddd931df0504dae5bd31582edddf7a8d5c35c717cb9529b09bcc0e55cedbc4e40ad0b4d332ccc38ee9a3195b983259f0f
7
- data.tar.gz: 355682afaf969c76fa71ddce7e153d361a06a34e89f32436ab8c839c9a4b79cac2a9ad2cfe790bfebd784e23c201b86fd5589c9137e4c51ffdcc6510635a32f5
6
+ metadata.gz: 51342978815a225ccde30a34ad2acea63e1914f73665ba6c928983c05c947fbcceea1506288eea1f7bb194f4b385f3b851974387ff7cbabef3fbb89ecd404491
7
+ data.tar.gz: 6b59ba2b4975c712f822f47b24ecbdeebdb138372f8df3345ff325de9b09e0fcbfd0b876abd426dc5da8fe9ece12f032ba7b18462c1dd9c3c3403f5ede40289a
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. This
4
4
  project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
5
5
  [keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).
6
6
 
7
+ ## [2.11.0](https://github.com/k0kubun/hamlit/compare/v2.10.0...v2.10.1) - 2019-12-12
8
+
9
+ ### Added
10
+
11
+ - Support Haml's _revealed_ conditional comment feature on `/![if !IE]` [#153](https://github.com/k0kubun/hamlit/issues/153).
12
+ *Thanks to @esb*
13
+
7
14
  ## [2.10.1](https://github.com/k0kubun/hamlit/compare/v2.10.0...v2.10.1) - 2019-11-28
8
15
 
9
16
  ### Added
data/REFERENCE.md CHANGED
@@ -57,6 +57,7 @@ for full features in original implementation.
57
57
  - [x] :plain
58
58
  - [x] :preserve
59
59
  - [x] :ruby
60
+ - `haml_io` API is not supported. Use [hamlit-haml\_io.gem](https://github.com/hamlit/hamlit-haml_io) if you need.
60
61
  - [x] :sass
61
62
  - [x] :scss
62
63
  - [ ] :textile
@@ -224,6 +225,14 @@ Hamlit::RailsTemplate.set_options attr_quote: '"'
224
225
  set :haml, { attr_quote: '"' }
225
226
  ```
226
227
 
228
+ ## Ruby module
229
+
230
+ `Hamlit::Template` is a module registered to `Tilt`. You can use it like:
231
+
232
+ ```rb
233
+ Hamlit::Template.new { "%strong Yay for HAML!" }.render
234
+ ```
235
+
227
236
  ## Creating a custom filter
228
237
 
229
238
  Currently it doesn't have filter registering interface compatible with Haml.
@@ -25,11 +25,13 @@ module Hamlit
25
25
  condition = $1
26
26
  end
27
27
 
28
- if node.children.empty?
29
- [:html, :condcomment, condition, [:static, " #{node.value[:text]} "]]
30
- else
31
- [:html, :condcomment, condition, yield(node)]
32
- end
28
+ content =
29
+ if node.children.empty?
30
+ [:static, " #{node.value[:text]} "]
31
+ else
32
+ yield(node)
33
+ end
34
+ [:html, :condcomment, condition, content, node.value[:revealed]]
33
35
  end
34
36
  end
35
37
  end
data/lib/hamlit/html.rb CHANGED
@@ -10,5 +10,13 @@ module Hamlit
10
10
  end
11
11
  super(opts)
12
12
  end
13
+
14
+ # This dispatcher supports Haml's "revealed" conditional comment.
15
+ def on_html_condcomment(condition, content, revealed = false)
16
+ on_html_comment [:multi,
17
+ [:static, "[#{condition}]>#{'<!-->' if revealed}"],
18
+ content,
19
+ [:static, "#{'<!--' if revealed}<![endif]"]]
20
+ end
13
21
  end
14
22
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Hamlit
3
- VERSION = '2.10.1'
3
+ VERSION = '2.11.0'
4
4
  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: 2.10.1
4
+ version: 2.11.0
5
5
  platform: java
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-29 00:00:00.000000000 Z
11
+ date: 2019-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement