haml 6.2.0 → 6.2.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 +4 -4
- data/CHANGELOG.md +5 -1
- data/FAQ.md +1 -1
- data/README.md +5 -5
- data/REFERENCE.md +25 -29
- data/lib/haml/attribute_builder.rb +6 -4
- 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: 28980224aeb7aaf767631d85d1a25371bd1e1fd78b87afa34ba5e300ee397126
|
4
|
+
data.tar.gz: c6e6cf4c766238cf501eb7695d75bc973746010a0c11bc90bce88d51d3d6b20d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42427402b30e767c124156562de33826ba7e16905a71ee38d494182bb0bd2f7f29135c1fd736702932ca656b94d3fdf8503e5829bd1d4cf62928eb3703261123
|
7
|
+
data.tar.gz: a8786a46da773e42d90bca9c29a9003a07be1a0b0f4ef2ad8ce7af117566ea96e891bc13ec22ccb5ab3ad0b6c62be8f247c7ac5b9db279c2f21cd0e4b3d06576
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Haml Changelog
|
2
2
|
|
3
|
+
## 6.2.1
|
4
|
+
|
5
|
+
* Fix v6.2.0's bug in rendering dynamic `aria` attributes [#1149](https://github.com/haml/haml/issues/1149)
|
6
|
+
|
3
7
|
## 6.2.0
|
4
8
|
|
5
9
|
* Drop the C extension [#1146](https://github.com/haml/haml/issues/1146)
|
@@ -1448,7 +1452,7 @@ Haml 2.2 introduces a new syntax for attributes
|
|
1448
1452
|
based on the HTML syntax.
|
1449
1453
|
For example:
|
1450
1454
|
|
1451
|
-
%a(href="
|
1455
|
+
%a(href="https://haml.info" title="Haml's so cool!")
|
1452
1456
|
%img(src="/images/haml.png" alt="Haml")
|
1453
1457
|
|
1454
1458
|
There are two main reasons for this.
|
data/FAQ.md
CHANGED
@@ -141,7 +141,7 @@ For other plugins, a little searching will probably turn up a way to fix them as
|
|
141
141
|
|
142
142
|
## You still haven't answered my question!
|
143
143
|
|
144
|
-
Sorry! Try looking at the [Haml](
|
144
|
+
Sorry! Try looking at the [Haml](https://haml.info/docs/yardoc/file.REFERENCE.html) reference,
|
145
145
|
If you can't find an answer there,
|
146
146
|
feel free to ask in `#haml` on irc.freenode.net
|
147
147
|
or send an email to the [mailing list](http://groups.google.com/group/haml).
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Haml
|
2
2
|
|
3
|
-
[](
|
3
|
+
[](https://rubygems.org/gems/haml)
|
4
4
|
[](https://github.com/haml/haml/actions/workflows/test.yml)
|
5
5
|
[](https://codeclimate.com/github/haml/haml)
|
6
6
|
[](https://inch-ci.org/github/haml/haml)
|
@@ -31,7 +31,7 @@ to compile it to HTML. For more information on these commands, check out
|
|
31
31
|
haml --help
|
32
32
|
~~~
|
33
33
|
|
34
|
-
To use Haml programmatically, check out the [YARD documentation](
|
34
|
+
To use Haml programmatically, check out the [YARD documentation](https://haml.info/docs/yardoc/).
|
35
35
|
|
36
36
|
## Using Haml with Rails
|
37
37
|
|
@@ -120,7 +120,7 @@ output the result. You can even use control statements like `if` and `while`:
|
|
120
120
|
~~~
|
121
121
|
|
122
122
|
Haml provides far more tools than those presented here. Check out the [reference
|
123
|
-
documentation](
|
123
|
+
documentation](https://haml.info/docs/yardoc/file.REFERENCE.html)
|
124
124
|
for full details.
|
125
125
|
|
126
126
|
### Indentation
|
@@ -132,7 +132,7 @@ can't be mixed, and the same number of tabs or spaces must be used throughout.
|
|
132
132
|
## Contributing
|
133
133
|
|
134
134
|
Contributions are welcomed, but before you get started please read the
|
135
|
-
[guidelines](
|
135
|
+
[guidelines](https://haml.info/development.html#contributing).
|
136
136
|
|
137
137
|
After forking and then cloning the repo locally, install Bundler and then use it
|
138
138
|
to install the development gem dependencies:
|
@@ -182,7 +182,7 @@ but still consults on language issues.
|
|
182
182
|
[Natalie Weizenbaum](http://nex-3.com) was for many years the primary developer
|
183
183
|
and architect of the "modern" Ruby implementation of Haml.
|
184
184
|
|
185
|
-
[Norman Clarke](
|
185
|
+
[Norman Clarke](https://github.com/norman) was the primary maintainer of Haml from 2012 to 2016.
|
186
186
|
|
187
187
|
## License
|
188
188
|
|
data/REFERENCE.md
CHANGED
@@ -1200,40 +1200,36 @@ You can also define your own filters.
|
|
1200
1200
|
|
1201
1201
|
The simplest example of a filter might be something like:
|
1202
1202
|
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
Haml::Filters.registered[:hello] ||= HelloFilter
|
1211
|
-
```
|
1203
|
+
class HelloFilter < Haml::Filters::Base
|
1204
|
+
def compile(_node)
|
1205
|
+
[:static, "hello world"]
|
1206
|
+
end
|
1207
|
+
end
|
1208
|
+
|
1209
|
+
Haml::Filters.registered[:hello] ||= HelloFilter
|
1212
1210
|
|
1213
1211
|
A more complex example:
|
1214
1212
|
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1213
|
+
class BetterFilter < Haml::Filters::Base
|
1214
|
+
def compile(node)
|
1215
|
+
temple = [:multi]
|
1216
|
+
temple << [:static, "hello "]
|
1217
|
+
temple << compile_text(node.value[:text])
|
1218
|
+
temple << [:static, " world"]
|
1219
|
+
temple
|
1220
|
+
end
|
1221
|
+
|
1222
|
+
private
|
1223
|
+
def compile_text(text)
|
1224
|
+
if ::Haml::Util.contains_interpolation?(text)
|
1225
|
+
[:dynamic, ::Haml::Util.unescape_interpolation(text)]
|
1226
|
+
else
|
1227
|
+
[:static, text]
|
1228
|
+
end
|
1229
|
+
end
|
1231
1230
|
end
|
1232
|
-
end
|
1233
|
-
end
|
1234
1231
|
|
1235
|
-
Haml::Filters.registered[:better] ||= BetterFilter
|
1236
|
-
```
|
1232
|
+
Haml::Filters.registered[:better] ||= BetterFilter
|
1237
1233
|
|
1238
1234
|
See {Haml::Filters} for examples.
|
1239
1235
|
|
@@ -18,12 +18,14 @@ module Haml::AttributeBuilder
|
|
18
18
|
keys = hash.keys.sort!
|
19
19
|
keys.each do |key|
|
20
20
|
case key
|
21
|
-
when 'id'
|
21
|
+
when 'id'
|
22
22
|
buf << " id=#{quote}#{build_id(escape_attrs, *hash[key])}#{quote}"
|
23
|
-
when 'class'
|
23
|
+
when 'class'
|
24
24
|
buf << " class=#{quote}#{build_class(escape_attrs, *hash[key])}#{quote}"
|
25
|
-
when 'data'
|
25
|
+
when 'data'
|
26
26
|
buf << build_data(escape_attrs, quote, *hash[key])
|
27
|
+
when 'aria'
|
28
|
+
buf << build_aria(escape_attrs, quote, *hash[key])
|
27
29
|
when *boolean_attributes, /\Adata-/
|
28
30
|
build_boolean!(escape_attrs, quote, format, buf, key, hash[key])
|
29
31
|
else
|
@@ -129,7 +131,7 @@ module Haml::AttributeBuilder
|
|
129
131
|
hash.each do |key, value|
|
130
132
|
key = key.to_s
|
131
133
|
case key
|
132
|
-
when 'id'
|
134
|
+
when 'id', 'class', 'data', 'aria'
|
133
135
|
merged[key] ||= []
|
134
136
|
merged[key] << value
|
135
137
|
else
|
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.2.
|
4
|
+
version: 6.2.1
|
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: 2023-
|
15
|
+
date: 2023-10-04 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: temple
|