haml 6.0.7 → 6.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +2 -8
- data/CHANGELOG.md +22 -2
- data/lib/haml/compiler/comment_compiler.rb +14 -2
- data/lib/haml/filters/tilt_base.rb +5 -1
- data/lib/haml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7cac6caf4e6a000adb17458dd0b65665d4c3bf3ccc1aa63fd13373628b8c0a1
|
4
|
+
data.tar.gz: 2e86dff9c54de2af99face10d8e3910a46cbb5544075f76d402c88ad36d461af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8619598cd1bc18afc3b34d22ecd5537758489fe4b51455296e13688c1c52e5b5909232d6d8a3c702153f3b9bbf51769a8ce08b0b028a917ee026bcfd6222326b
|
7
|
+
data.tar.gz: ec437a3aa3de4e6327ff0335f0d27faa041fbc01c031af7bf22d4f72821d19941cf63f488d0744d3cfdb12034ebfd40c25999a16a86a998a2d0e5dfc4c020f25
|
data/.github/workflows/test.yml
CHANGED
@@ -25,16 +25,10 @@ jobs:
|
|
25
25
|
- truffleruby-head
|
26
26
|
steps:
|
27
27
|
- uses: actions/checkout@v2
|
28
|
+
- run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev # nodejs for execjs, libxslt for TruffleRuby nokogiri
|
28
29
|
- name: Set up Ruby
|
29
30
|
uses: ruby/setup-ruby@v1
|
30
31
|
with:
|
31
32
|
ruby-version: ${{ matrix.ruby }}
|
32
|
-
|
33
|
-
with:
|
34
|
-
path: vendor/bundle
|
35
|
-
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
36
|
-
restore-keys: ${{ runner.os }}-gems-
|
37
|
-
- run: sudo apt-get update && sudo apt-get install -y nodejs libxslt-dev # nodejs for execjs, libxslt for TruffleRuby nokogiri
|
38
|
-
- name: bundle install
|
39
|
-
run: bundle config path vendor/bundle && bundle install -j$(nproc) --retry 3
|
33
|
+
bundler-cache: true
|
40
34
|
- run: bundle exec rake test
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Haml Changelog
|
2
2
|
|
3
|
+
## 6.0.9
|
4
|
+
|
5
|
+
* Support sass-embedded [#1112](https://github.com/haml/haml/issues/1112)
|
6
|
+
|
7
|
+
## 6.0.8
|
8
|
+
|
9
|
+
* Support interpolation in HTML comments, which has not been working since 6.0.0
|
10
|
+
[#1107](https://github.com/haml/haml/issues/1107)
|
11
|
+
|
3
12
|
## 6.0.7
|
4
13
|
|
5
14
|
* `Haml::Engine` and `Haml::Template` use StringBuffer instead of ArrayBuffer
|
@@ -58,6 +67,8 @@ Released on September 21, 2022
|
|
58
67
|
* The parser is kept as is, but everything else is replaced.
|
59
68
|
* The `haml` CLI interface was also replaced.
|
60
69
|
* The interface of `Haml::Engine` is changed. `Haml::Template` is most likely what you need now.
|
70
|
+
* before: `Haml::Engine.new("%p Haml code!").render`
|
71
|
+
* after: `Haml::Template.new { "%p Haml code!" }.render`
|
61
72
|
* Most Haml helpers are removed.
|
62
73
|
* Rails:
|
63
74
|
* Kept: `find_and_reserve`, `preserve`, `surround`, `precede`, `succeed`, `capture_haml`
|
@@ -68,9 +79,18 @@ Released on September 21, 2022
|
|
68
79
|
* Removed: `block_is_haml?`, `capture_haml`, `escape_once`, `find_and_preserve`, `flatten`, `haml_concat`,
|
69
80
|
`haml_indent`, `haml_tag`, `haml_tag_if`, `html_attrs`, `html_escape`, `init_haml_helpers`, `is_haml?`,
|
70
81
|
`list_of`, `non_haml`, `precede`, `succeed`, `surround`, `tab_down`, `tab_up`, `with_tabs`
|
71
|
-
* Only the attributes
|
72
|
-
|
82
|
+
* Only the following attributes and `aria`/`data` attributes are considered boolean attributes:
|
83
|
+
* `allowfullscreen`, `async`, `autobuffer`, `autofocus`, `autoplay`, `checked`, `controls`, `default`,
|
84
|
+
`defer`, `disabled`, `download`, `formnovalidate`, `hidden`, `inert`, `ismap`, `itemscope`, `loop`,
|
85
|
+
`multiple`, `muted`, `novalidate`, `open`, `pubdate`, `readonly`, `required`, `reversed`, `scoped`,
|
86
|
+
`seamless`, `selected`, `sortable`, `truespeed`, `typemustmatch`
|
87
|
+
* Only `data` and `aria` attributes support using a nested Hash to render hyphenated attributes, e.g.
|
88
|
+
`data: { foo: 'bar' }` becomes `data-foo="bar"`, but this no longer works for non-`data`/`aria` attributes.
|
73
89
|
* Some legacy Rails integration is removed.
|
90
|
+
* The default value of `escape_html` option became true.
|
91
|
+
* `-` script lines no longer support capturing. Only `=` lines are supported to yield a nested block.
|
92
|
+
* Overriding `data` attributes with another falsy `data-*` attribute that has the same name
|
93
|
+
is no longer supported. [#1105](https://github.com/haml/haml/issues/1105)
|
74
94
|
|
75
95
|
## 5.2.2
|
76
96
|
|
@@ -14,7 +14,7 @@ module Haml
|
|
14
14
|
|
15
15
|
def compile_html_comment(node, &block)
|
16
16
|
if node.children.empty?
|
17
|
-
[:html, :comment,
|
17
|
+
[:html, :comment, compile_text(node)]
|
18
18
|
else
|
19
19
|
[:html, :comment, yield(node)]
|
20
20
|
end
|
@@ -28,12 +28,24 @@ module Haml
|
|
28
28
|
|
29
29
|
content =
|
30
30
|
if node.children.empty?
|
31
|
-
|
31
|
+
compile_text(node)
|
32
32
|
else
|
33
33
|
yield(node)
|
34
34
|
end
|
35
35
|
[:html, :condcomment, condition, content, node.value[:revealed]]
|
36
36
|
end
|
37
|
+
|
38
|
+
def compile_text(node)
|
39
|
+
text =
|
40
|
+
if node.value[:parse]
|
41
|
+
# Just always escaping the result for safety. We could respect
|
42
|
+
# escape_html, but I don't see any use case for it.
|
43
|
+
[:escape, true, [:dynamic, node.value[:text]]]
|
44
|
+
else
|
45
|
+
[:static, node.value[:text]]
|
46
|
+
end
|
47
|
+
[:multi, [:static, ' '], text, [:static, ' ']]
|
48
|
+
end
|
37
49
|
end
|
38
50
|
end
|
39
51
|
end
|
@@ -7,7 +7,11 @@ module Haml
|
|
7
7
|
def self.render(name, source, indent_width: 0)
|
8
8
|
text = ::Tilt["t.#{name}"].new { source }.render
|
9
9
|
return text if indent_width == 0
|
10
|
-
text.
|
10
|
+
if text.frozen?
|
11
|
+
text.gsub(/^/, ' ' * indent_width)
|
12
|
+
else
|
13
|
+
text.gsub!(/^/, ' ' * indent_width)
|
14
|
+
end
|
11
15
|
end
|
12
16
|
|
13
17
|
def explicit_require?(needed_registration)
|
data/lib/haml/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Natalie Weizenbaum
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date: 2022-
|
15
|
+
date: 2022-11-08 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: temple
|