Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

merge dblock'squote fixes

  • Loading branch information...
commit cb68c7aa486626bd7638bafa92581ed7084f6bc5 1 parent 3113012
@dblock dblock authored RSL committed
View
2  lib/stringex/string_extensions.rb
@@ -185,7 +185,7 @@ def convert_misc_characters(options = {})
replaced = " #{replaced} " unless replaced =~ /\\1/
dummy.gsub!(found, replaced)
end
- dummy = dummy.gsub(/(^|\w)'(\w|$)/, '\1\2').gsub(/[\.,:;()\[\]\?!\^'"_]/, " ")
+ dummy = dummy.gsub(/(^|[[:alpha:]])'([[:alpha:]]|$)/, '\1\2').gsub(/[\.,:;()\[\]\/\?!\^'ʼ"_]/, " ")
end
# Replace runs of whitespace in string. Defaults to a single space but any replacement
View
18 test/string_extensions_test.rb
@@ -49,10 +49,26 @@ def test_to_url
"im-just-making-sure-theres-nothing-wrong-with-things",
"foo = bar and bar=foo" =>
"foo-equals-bar-and-bar-equals-foo",
+ "Period.period" =>
+ "period-dot-period",
"Will…This Work?" =>
"will-dot-dot-dot-this-work",
"¼ pound with cheese" =>
- "one-fourth-pound-with-cheese"
+ "one-fourth-pound-with-cheese",
+ "Will's Ferrel" =>
+ "wills-ferrel",
+ "Капитал" =>
+ "kapital",
+ "Ελλάδα" =>
+ "ellada",
+ "中文" =>
+ "zhong-wen",
+ "Paul Cézanne" =>
+ "paul-cezanne",
+ "21'17ʼ51" =>
+ "21-17-51",
+ "ITCZ 1 (21°17ʼ51.78”N / 89°35ʼ28.18”O / 26-04-08 / 09:00 am)" =>
+ "itcz-1-21deg17-51-dot-78-n-slash-89deg35-28-dot-18-o-slash-26-04-08-slash-09-00-am"
}.each do |html, plain|
assert_equal plain, html.to_url
end
Please sign in to comment.
Something went wrong with that request. Please try again.