haml 6.1.2 → 6.1.4
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 +18 -0
- data/ext/haml/haml.c +1 -9
- data/lib/haml/rails_template.rb +5 -0
- data/lib/haml/util.rb +5 -4
- data/lib/haml/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d737ee35f4f57bdbbedceeb61233e0b21818fee84a50e00a1e317b2a8efcb50
|
|
4
|
+
data.tar.gz: 6e8a41c9e3a9e8c9db478f0c5ea636a6eb8bb2fe811b609664808edfac204645
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b298a5a331bf81368054ac7fbae382a4ea739d9b24a8aa2db68ddf0e9595e116d3439ae75ddf73bd16dc943ee5e6fa0bdcd3f693ddf09c5abf54eaacbcfd9b14
|
|
7
|
+
data.tar.gz: b5ebe7e3ae7337224db692aad4c116674a6992e0880f46e96a4e9486d72bf22f57b3d1fb94396353d3b06d680387fbfb24f4dcc7ef0eb17dca4acbc7bc0336e9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Haml Changelog
|
|
2
2
|
|
|
3
|
+
## 6.1.4
|
|
4
|
+
|
|
5
|
+
* Let `Haml::Util.escape_html` use `ERB::Escape` if available [#1145](https://github.com/haml/haml/issues/1145)
|
|
6
|
+
|
|
7
|
+
## 6.1.3
|
|
8
|
+
|
|
9
|
+
* Add `Haml::RailsTemplate#default_format` for Turbo compatibility [#1144](https://github.com/haml/haml/issues/1144)
|
|
10
|
+
|
|
11
|
+
## 6.1.2
|
|
12
|
+
|
|
13
|
+
* Use the rails template path as `filename` [#1140](https://github.com/haml/haml/issues/1140)
|
|
14
|
+
|
|
3
15
|
## 6.1.1
|
|
4
16
|
|
|
5
17
|
* Fix an empty output of Ruby 3.1's Hash shorthand syntax [#1083](https://github.com/haml/haml/issues/1083)
|
|
@@ -102,6 +114,12 @@ Released on September 21, 2022
|
|
|
102
114
|
`list_of`, `non_haml`, `precede`, `succeed`, `surround`, `tab_down`, `tab_up`, `with_tabs`
|
|
103
115
|
* `:ruby` filter
|
|
104
116
|
* Removed: `haml_io`
|
|
117
|
+
* Alternatives to the removed helpers:
|
|
118
|
+
* Some simple ones could work by copying [the original definition](https://github.com/haml/haml/blob/v5.2.2/lib/haml/helpers.rb).
|
|
119
|
+
* For helpers generating general HTML tags, also consider using what your framework provides, e.g. Rails `content_tag`.
|
|
120
|
+
Same applies to `capture_haml`, e.g. Rails `capture`.
|
|
121
|
+
* Ones that rely on `Haml::Buffer` have no direct alternative by design. They existed at the cost of performance.
|
|
122
|
+
You need to define a helper, instantiate a String buffer in it, append stuff to it, and call it inside `=`.
|
|
105
123
|
* Only the following attributes and `aria`/`data` attributes are considered boolean attributes:
|
|
106
124
|
* `allowfullscreen`, `async`, `autobuffer`, `autofocus`, `autoplay`, `checked`, `controls`, `default`,
|
|
107
125
|
`defer`, `disabled`, `download`, `formnovalidate`, `hidden`, `inert`, `ismap`, `itemscope`, `loop`,
|
data/ext/haml/haml.c
CHANGED
|
@@ -77,12 +77,6 @@ escape_attribute(VALUE escape_attrs, VALUE str)
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
static VALUE
|
|
81
|
-
rb_escape_html(RB_UNUSED_VAR(VALUE self), VALUE value)
|
|
82
|
-
{
|
|
83
|
-
return escape_html(to_s(value));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
80
|
static VALUE
|
|
87
81
|
haml_build_id(VALUE escape_attrs, VALUE values)
|
|
88
82
|
{
|
|
@@ -504,14 +498,12 @@ rb_haml_build(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self))
|
|
|
504
498
|
void
|
|
505
499
|
Init_haml(void)
|
|
506
500
|
{
|
|
507
|
-
VALUE mHaml
|
|
501
|
+
VALUE mHaml;
|
|
508
502
|
|
|
509
503
|
mHaml = rb_define_module("Haml");
|
|
510
504
|
mObjectRef = rb_define_module_under(mHaml, "ObjectRef");
|
|
511
|
-
mUtil = rb_define_module_under(mHaml, "Util");
|
|
512
505
|
mAttributeBuilder = rb_define_module_under(mHaml, "AttributeBuilder");
|
|
513
506
|
|
|
514
|
-
rb_define_singleton_method(mUtil, "escape_html", rb_escape_html, 1);
|
|
515
507
|
rb_define_singleton_method(mAttributeBuilder, "build", rb_haml_build, -1);
|
|
516
508
|
rb_define_singleton_method(mAttributeBuilder, "build_id", rb_haml_build_id, -1);
|
|
517
509
|
rb_define_singleton_method(mAttributeBuilder, "build_class", rb_haml_build_class, -1);
|
data/lib/haml/rails_template.rb
CHANGED
data/lib/haml/util.rb
CHANGED
|
@@ -14,15 +14,16 @@ module Haml
|
|
|
14
14
|
module Util
|
|
15
15
|
extend self
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
|
|
17
|
+
begin # Ruby 3.2+ or ERB 4+
|
|
18
|
+
require 'erb/escape'
|
|
19
|
+
|
|
20
|
+
define_singleton_method(:escape_html, ERB::Escape.instance_method(:html_escape))
|
|
21
|
+
rescue LoadError
|
|
19
22
|
require 'cgi/escape'
|
|
20
23
|
|
|
21
24
|
def self.escape_html(html)
|
|
22
25
|
CGI.escapeHTML(html.to_s)
|
|
23
26
|
end
|
|
24
|
-
else
|
|
25
|
-
require 'haml/haml' # Haml::Util.escape_html
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
# TODO: Remove unescape_interpolation's workaround and get rid of `respond_to?`.
|
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.1.
|
|
4
|
+
version: 6.1.4
|
|
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-09-27 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: temple
|
|
@@ -356,7 +356,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
356
356
|
- !ruby/object:Gem::Version
|
|
357
357
|
version: '0'
|
|
358
358
|
requirements: []
|
|
359
|
-
rubygems_version: 3.4.
|
|
359
|
+
rubygems_version: 3.4.10
|
|
360
360
|
signing_key:
|
|
361
361
|
specification_version: 4
|
|
362
362
|
summary: An elegant, structured (X)HTML/XML templating engine.
|