phlex 1.7.2 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of phlex might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/CHANGELOG.md +7 -1
- data/lib/phlex/sgml.rb +5 -6
- data/lib/phlex/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: 463bbaade702e9495ee8965c20ca4c5aeb926b10a2e190584a0a0dfcc4f43709
|
4
|
+
data.tar.gz: f57de49b85bfc10920f890581656a7aa1c86d6d120ce45017c9fc0c355587514
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf30a011b71eb056c093b0e0691e635b7fc60f3b2ed533fec63d65bd8c29ca5ddea794ac054a33c27cb2b79e8caab587299522707646c34c12a822a819aeba05
|
7
|
+
data.tar.gz: c8dc0e52c90c686e0824ee611afb303c8cdb8c9d9ebbb0293e1f0a0905e83a302499cabca54e44f2bddbe859ac43dd71d004f4f05b1feaf3dbd8d7f9696f24b8
|
data/.yardopts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--private --
|
1
|
+
--private --hide-api private --markup markdown
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,13 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
4
4
|
|
5
|
-
## 1.
|
5
|
+
## [1.8.0] 2024-04-19
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
- Support `Integer` and `Float` attribute values, and fall back to calling `to_str` on other objects.
|
10
|
+
|
11
|
+
## [1.7.0] 2024-04-18
|
6
12
|
|
7
13
|
### Added
|
8
14
|
|
data/lib/phlex/sgml.rb
CHANGED
@@ -337,7 +337,7 @@ module Phlex
|
|
337
337
|
when Symbol
|
338
338
|
@_context.target << ERB::Escape.html_escape(content.name)
|
339
339
|
when Integer
|
340
|
-
@_context.target <<
|
340
|
+
@_context.target << content.to_s
|
341
341
|
when nil
|
342
342
|
nil
|
343
343
|
else
|
@@ -389,11 +389,8 @@ module Phlex
|
|
389
389
|
else raise ArgumentError, "Attribute keys should be Strings or Symbols."
|
390
390
|
end
|
391
391
|
|
392
|
-
lower_name = name.downcase
|
393
|
-
next if lower_name == "href" && v.to_s.downcase.tr("\t \n", "").start_with?("javascript:")
|
394
|
-
|
395
392
|
# Detect unsafe attribute names. Attribute names are considered unsafe if they match an event attribute or include unsafe characters.
|
396
|
-
if HTML::EVENT_ATTRIBUTES[
|
393
|
+
if HTML::EVENT_ATTRIBUTES[name] || name.match?(/[<>&"']/)
|
397
394
|
raise ArgumentError, "Unsafe attribute name detected: #{k}."
|
398
395
|
end
|
399
396
|
|
@@ -404,6 +401,8 @@ module Phlex
|
|
404
401
|
buffer << " " << name << '="' << ERB::Escape.html_escape(v) << '"'
|
405
402
|
when Symbol
|
406
403
|
buffer << " " << name << '="' << ERB::Escape.html_escape(v.name) << '"'
|
404
|
+
when Integer, Float
|
405
|
+
buffer << " " << name << '="' << v.to_s << '"'
|
407
406
|
when Hash
|
408
407
|
__build_attributes__(
|
409
408
|
v.transform_keys { |subkey|
|
@@ -418,7 +417,7 @@ module Phlex
|
|
418
417
|
when Set
|
419
418
|
buffer << " " << name << '="' << ERB::Escape.html_escape(v.to_a.compact.join(" ")) << '"'
|
420
419
|
else
|
421
|
-
|
420
|
+
buffer << " " << name << '="' << ERB::Escape.html_escape(v.to_str) << '"'
|
422
421
|
end
|
423
422
|
end
|
424
423
|
|
data/lib/phlex/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joel Drapper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
- !ruby/object:Gem::Version
|
120
120
|
version: '0'
|
121
121
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
122
|
+
rubygems_version: 3.4.10
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: A fun framework for building views in Ruby.
|