haml 6.0.4-java → 6.0.5-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 +4 -4
- data/CHANGELOG.md +6 -0
- data/REFERENCE.md +39 -1
- data/lib/haml/engine.rb +1 -0
- data/lib/haml/object_ref.rb +6 -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: e590841334e96540c2233dcb64895ca41527d57a4563b25a6ad8454e3efdfc6e
|
4
|
+
data.tar.gz: 42901be1be77d381f5b2823249c39adf9f19712bd367be8e97046abe97baaada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d3d0c153a75ccccea17416c4edd1d8fe6519e618c620d4a5be013bea97094fd262e9075b3b0b725060fd23c59aca21269b89ac7b4564bcdc5734523a9f1397f
|
7
|
+
data.tar.gz: 3e072c029afc62da06302b6e2faf404afc5f5f22d49c324966e39be622e2693a912d4f671084336fabf1f45141a4e56e645b081a8e3790613dfdf3a1fcdb396a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Haml Changelog
|
2
2
|
|
3
|
+
## 6.0.5
|
4
|
+
|
5
|
+
* Resurrect `#haml_object_ref` support in an object reference [#1097](https://github.com/haml/haml/issues/1097)
|
6
|
+
* This was removed in 6.0.0, and added back in this version.
|
7
|
+
* Stop warning `remove_whitespace: true` option.
|
8
|
+
|
3
9
|
## 6.0.4
|
4
10
|
|
5
11
|
Released on October 2, 2022
|
data/REFERENCE.md
CHANGED
@@ -81,6 +81,32 @@ You can then use it by including the `haml` gem in Ruby code, and using
|
|
81
81
|
engine = Haml::Template.new { "%p Haml code!" }
|
82
82
|
engine.render #=> "<p>Haml code!</p>\n"
|
83
83
|
|
84
|
+
### Options
|
85
|
+
|
86
|
+
Haml understands various configuration options that affect its performance and
|
87
|
+
output.
|
88
|
+
|
89
|
+
In Rails, options can be set by using `Haml::RailsTemplate.set_options` in an initializer:
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
# config/initializers/haml.rb
|
93
|
+
Haml::RailsTemplate.set_options(escape_html: false)
|
94
|
+
```
|
95
|
+
|
96
|
+
Outside Rails, you can set them by configuring them globally in `Haml::Template.options`:
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
Haml::Template.options[:escape_html] = false
|
100
|
+
```
|
101
|
+
|
102
|
+
In sinatra specifically, you can set them in global config with:
|
103
|
+
```ruby
|
104
|
+
set :haml, { escape_html: false }
|
105
|
+
```
|
106
|
+
|
107
|
+
Finally, you can also set them by passing an options hash to `Haml::Engine.new` or `Haml::Template.new`.
|
108
|
+
For the complete list of available options, please see `Haml::Engine`.
|
109
|
+
|
84
110
|
## Plain Text
|
85
111
|
|
86
112
|
A substantial portion of any HTML document is its content, which is plain old
|
@@ -294,7 +320,19 @@ or using `true` and `false`:
|
|
294
320
|
%input(selected=true)
|
295
321
|
|
296
322
|
This feature works only for attributes that are included in
|
297
|
-
[`Haml::AttributeBuilder::BOOLEAN_ATTRIBUTES`](lib/haml/attribute_builder.rb)
|
323
|
+
[`Haml::AttributeBuilder::BOOLEAN_ATTRIBUTES`](lib/haml/attribute_builder.rb),
|
324
|
+
as well as `data-` and `aria-` attributes.
|
325
|
+
|
326
|
+
%input{'data-hidden' => false}
|
327
|
+
%input{'aria-hidden' => false}
|
328
|
+
%input{'xyz-hidden' => false}
|
329
|
+
|
330
|
+
will render as:
|
331
|
+
|
332
|
+
<input>
|
333
|
+
<input>
|
334
|
+
<input xyz-hidden='false'>
|
335
|
+
|
298
336
|
|
299
337
|
<!-- The title to the next section (Prefixed Attributes) has changed. This
|
300
338
|
<a> tag is so old links to here still work. -->
|
data/lib/haml/engine.rb
CHANGED
data/lib/haml/object_ref.rb
CHANGED
@@ -6,7 +6,12 @@ module Haml
|
|
6
6
|
object, prefix = args
|
7
7
|
return {} unless object
|
8
8
|
|
9
|
-
suffix =
|
9
|
+
suffix =
|
10
|
+
if object.respond_to?(:haml_object_ref)
|
11
|
+
object.haml_object_ref
|
12
|
+
else
|
13
|
+
underscore(object.class)
|
14
|
+
end
|
10
15
|
{
|
11
16
|
'class' => [prefix, suffix].compact.join('_'),
|
12
17
|
'id' => [prefix, suffix, object.id || 'new'].compact.join('_'),
|
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.5
|
5
5
|
platform: java
|
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-10-
|
15
|
+
date: 2022-10-05 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|