Skip to content

Commit

Permalink
Fix ‘24
Browse files Browse the repository at this point in the history
  • Loading branch information
pbhogan committed Feb 20, 2024
1 parent 77c9720 commit 28312da
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
sterile (1.0.24)
sterile (1.0.26)
nokogiri (>= 1.11.7)

GEM
Expand Down
2 changes: 2 additions & 0 deletions lib/sterile/data/smart_format_rules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def self.smart_format_rules
["(R)", "®"],
['"/"', "”/“"],
["'/'", "’/‘"],
[/([iI][nN]\s+)\'(\d\d\D)/, "\\1’\\2"],
[/([iI][nN]\s+)\'(\d\d)$/, "\\1’\\2"],
[/\'(\d\d)(?!’|\'|[^’\'\s]+[’\'][\p{P}\p{Z}])([\p{P}\p{Z}])/, "’\\1\\2"],
# [/<p>"/, "<p>\\1″"],
[/s\'([^a-zA-Z0-9])/, "s’\\1"],
Expand Down
2 changes: 1 addition & 1 deletion lib/sterile/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: UTF-8

module Sterile
VERSION = "1.0.25"
VERSION = "1.0.26"
end

8 changes: 8 additions & 0 deletions test/test_sterile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,13 @@ def test_quote_slash_quote
assert_equal "‘one’/‘two’", Sterile.smart_format("'one'/'two'")
end

def test_number_single_quote
assert_equal "War in ’24", Sterile.smart_format("War in '24")
end

def test_number_single_quote_in_double_quotes
assert_equal "“War in ’24”", Sterile.smart_format("\"War in '24\"")
end

end

0 comments on commit 28312da

Please sign in to comment.