i18nliner 0.2.1 → 0.2.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: 49a54d15655300760797d011db9521a123b23892478badcee8cfab3c7c890e25
4
- data.tar.gz: 97409ad1106e9ed7c68567038bca41495e204545fce5b605b2b30e591072c399
3
+ metadata.gz: f9f3816293c70dfd95ca1cd66cb80d611f283c416e2dc0bd9eec08723d33f32e
4
+ data.tar.gz: e41ce0ba376064862cc64d063b2ac2cdf48002136446079f403255e9cb6a69b9
5
5
  SHA512:
6
- metadata.gz: d81cc7123036ef5a7f19224d2400b384f4049bee9be1ea9a99d40b12ea2db8739f547861e93bff7c51f7639c1877c0ae672a850325e85a59817ba678b455d31a
7
- data.tar.gz: 0b465bc13a850bd61ffdbc2459d698f55719cc5cc5cab1bd55ca8e8bfabba8a12a7214def2c95a0fd682b50d4fd4af03092fd4815702081524f1fe92e468a18c
6
+ metadata.gz: b31d8fdd70c548e770d92584e9c35f6ce15ca60a6bc8a1d835cb2b90653b6de63029d35fcd2465245d473f1cab5914634a290faa344c8a5ec0e115dfcb4947b1
7
+ data.tar.gz: 90a338c6438b59dfa6b0f51af4f4c97b747b068390e975f68e8a6af9ba5ddf3b0c735ffc2e46ca7fe63effc8c5ce2f037e6a808b6a50ae197a9d5110a5088895
@@ -19,12 +19,13 @@ module I18nliner
19
19
  wrappers = options.delete(:wrappers) || options.delete(:wrapper)
20
20
  result = super(key, options)
21
21
 
22
- # In rails 6.1+ views, sometimes an Object is used for the default, and that object needs to remain
23
- # an object or it won't be recognized if it comes back as a string
24
- return result if result.nil? || result.instance_of?(Object)
22
+ # Exit now unless we have a string or a thing that delegates to a string
23
+ return result unless result.respond_to?(:gsub)
25
24
 
25
+ was_html_safe = result.html_safe?
26
26
  # If you are actually using nonprintable characters in your source string, you should feel ashamed
27
27
  result = result.gsub("\\\\", "\uE124").gsub("\\*", "\uE123")
28
+ result = result.html_safe if was_html_safe
28
29
  if wrappers
29
30
  result = apply_wrappers(result, wrappers)
30
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18nliner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Jensen