htmlentities 4.4.1 → 4.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21ce636a251cd7ad0961988794c4910f0b281d20d7f99e698fdf54ac89671b41
4
- data.tar.gz: 227a7532b51265fe6672267894158a6112a58aea1fe9136f6cce04f7a2caba03
3
+ metadata.gz: 26b4e0dbd92933651e09edc0341a443fe1fae85973ffa591603824e4f7008fbc
4
+ data.tar.gz: 2c51ff967b5ab49d4418c79a91880c744243de7103151c269c192f08f431a7d5
5
5
  SHA512:
6
- metadata.gz: 542e86aed05c338f9484b3a4be014509d620f7375e6835698153602249fc2da624dd76daa77d0e20c8ceddbd02539658e10f7bccd9881799467c4a23be0ca8a2
7
- data.tar.gz: 0b282bf654ef903e2aea4c8a9e29f83235197fa4c7103f2a77d91678c432444fb5613aff16097baddd262a236bb4ab0a645625cb4b504da5382118f9417235b6
6
+ metadata.gz: 5af94066c94cba4b8be2886a3a7f635614780aed1196cb63eed8229985548a2a8b33a469cf8ee582d778342d2e3503221de0f73a51e887df96741c20872db070
7
+ data.tar.gz: 77a6f7e211695c2417f808100f64491a6ed7a729688ef598ea71ce486ec8b6bd60772679896aa739ce4c6b0b77ef3954db6a59c53a834040835e4c3109b79e4c
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 4.4.2 (2025-11-20)
2
+ * Optimise encoding in the default case.
3
+
1
4
  == 4.4.1 (2025-11-19)
2
5
  * Restore support for some older unsupported Ruby versions (down to 2.7).
3
6
 
@@ -2,7 +2,7 @@ class HTMLEntities
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 4
4
4
  MINOR = 4
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/htmlentities.rb CHANGED
@@ -70,6 +70,10 @@ class HTMLEntities
70
70
  # contains valid UTF-8 before calling this method.
71
71
  #
72
72
  def encode(source, *instructions)
73
- Encoder.new(@flavor, instructions).encode(source)
73
+ if instructions.empty?
74
+ (@default_encoder ||= Encoder.new(@flavor, instructions)).encode(source)
75
+ else
76
+ Encoder.new(@flavor, instructions).encode(source)
77
+ end
74
78
  end
75
79
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmlentities
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.1
4
+ version: 4.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Battley
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-11-19 00:00:00.000000000 Z
10
+ date: 2025-11-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rake