metadata_presenter 3.3.27 → 3.3.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6484a85f12c44c247efe949f357a2492cd0bb4610c655fcc218f5c75b7f9301
4
- data.tar.gz: 45415ebbb786f364891e9e0d104ca40dbf6e082193b514362b805f8a5aaab7f5
3
+ metadata.gz: 8b4d904af9c3e0a5d4d9fc730f426242bf9bcd54f5200aeeb6fcedba69fe7182
4
+ data.tar.gz: b9e2ba21c2fd43ccda2dcc52fa139482a4882acdeabab4e20d1dcac520408497
5
5
  SHA512:
6
- metadata.gz: 2ce0cecb7c76abd166a3f5b56f46769da32225a1e997a06237fc5dd2a2d690b0e86dab3bbba932426cb3f1509aa7804f09c41c0ecaee3c0bda29e7bdc5b5e5bb
7
- data.tar.gz: d4f8e6ab7cb34a911005154f2abe15a1f7a9db9fb5c4f0ef000b2dd2dca586c787a4150ffd7ffb14220b609469b2ba6d90148afc99854b62cb416d0bcefd8392
6
+ metadata.gz: 22ddccac4842f0c32a4e063d44a12792832259912ed3625302ef7d68abd519773c85c132fe586cf889261464b635ffc60630a33d820e466129089a7c5877cc88
7
+ data.tar.gz: 622fdf7db6971a90c17c67365013ddec444066fa108108378fc4e68f7fefed966aefbeb04c2c07cb86f1216d29d2d04f469ca479d62b30c12e62ad9693288155
@@ -11,11 +11,18 @@ module MetadataPresenter
11
11
  def invalid_answer?
12
12
  return if autocomplete_item_list.blank?
13
13
 
14
- autocomplete_item_list.exclude?(JSON.parse(user_answer))
14
+ autocomplete_item_list.exclude?(JSON.parse(sanitized_user_answer))
15
15
  end
16
16
 
17
17
  def autocomplete_item_list
18
18
  @autocomplete_item_list ||= autocomplete_items[component.uuid]
19
19
  end
20
+
21
+ private
22
+
23
+ def sanitized_user_answer
24
+ result = user_answer.gsub(/&/, '&')
25
+ result.gsub(/\\u0026/, '&')
26
+ end
20
27
  end
21
28
  end
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '3.3.27'.freeze
2
+ VERSION = '3.3.28'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metadata_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.27
4
+ version: 3.3.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-22 00:00:00.000000000 Z
11
+ date: 2024-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder