Fix rubocop errors & add one more test for slugify 'ascii' mode (#4680)
This commit is contained in:
parent
9164973a6c
commit
c1e6f1fb94
|
|
@ -23,7 +23,7 @@ Metrics/ClassLength:
|
||||||
- !ruby/regexp /test\/.*.rb$/
|
- !ruby/regexp /test\/.*.rb$/
|
||||||
Max: 300
|
Max: 300
|
||||||
Metrics/CyclomaticComplexity:
|
Metrics/CyclomaticComplexity:
|
||||||
Max: 8
|
Max: 9
|
||||||
Metrics/LineLength:
|
Metrics/LineLength:
|
||||||
Exclude:
|
Exclude:
|
||||||
- !ruby/regexp /features\/.*.rb/
|
- !ruby/regexp /features\/.*.rb/
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ module Jekyll
|
||||||
# "._~!$&'()+,;=@" is human readable (not URI-escaped) in URL
|
# "._~!$&'()+,;=@" is human readable (not URI-escaped) in URL
|
||||||
# and is allowed in both extN and NTFS.
|
# and is allowed in both extN and NTFS.
|
||||||
SLUGIFY_PRETTY_REGEXP
|
SLUGIFY_PRETTY_REGEXP
|
||||||
when 'ascii'
|
when "ascii"
|
||||||
# For web servers not being able to handle Unicode, the safe
|
# For web servers not being able to handle Unicode, the safe
|
||||||
# method is to ditch anything else but latin letters and numeric
|
# method is to ditch anything else but latin letters and numeric
|
||||||
# digits.
|
# digits.
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,10 @@ class TestUtils < JekyllUnitTest
|
||||||
end
|
end
|
||||||
|
|
||||||
should "replace everything else but ASCII characters" do
|
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
|
end
|
||||||
|
|
||||||
should "only replace whitespace if mode is raw" do
|
should "only replace whitespace if mode is raw" do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue