mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-06 03:01:43 -04:00
Fix rubocop errors & add one more test for slugify 'ascii' mode (#4680)
This commit is contained in:
@@ -23,7 +23,7 @@ Metrics/ClassLength:
|
||||
- !ruby/regexp /test\/.*.rb$/
|
||||
Max: 300
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 8
|
||||
Max: 9
|
||||
Metrics/LineLength:
|
||||
Exclude:
|
||||
- !ruby/regexp /features\/.*.rb/
|
||||
|
||||
@@ -200,7 +200,7 @@ module Jekyll
|
||||
# "._~!$&'()+,;=@" is human readable (not URI-escaped) in URL
|
||||
# and is allowed in both extN and NTFS.
|
||||
SLUGIFY_PRETTY_REGEXP
|
||||
when 'ascii'
|
||||
when "ascii"
|
||||
# For web servers not being able to handle Unicode, the safe
|
||||
# method is to ditch anything else but latin letters and numeric
|
||||
# digits.
|
||||
|
||||
@@ -199,7 +199,10 @@ class TestUtils < JekyllUnitTest
|
||||
end
|
||||
|
||||
should "replace everything else but ASCII characters" do
|
||||
assert_equal "the-config-yml-file", Utils.slugify("The _config.yml file?", mode: "ascii")
|
||||
assert_equal "the-config-yml-file",
|
||||
Utils.slugify("The _config.yml file?", :mode => "ascii")
|
||||
assert_equal "f-rtive-glance",
|
||||
Utils.slugify("fürtive glance!!!!", :mode => "ascii")
|
||||
end
|
||||
|
||||
should "only replace whitespace if mode is raw" do
|
||||
|
||||
Reference in New Issue
Block a user