parent
757f47b21c
commit
2bdf1a53c4
|
@ -222,6 +222,7 @@ module Jekyll
|
||||||
slug.gsub!(%r!^\-|\-$!i, "")
|
slug.gsub!(%r!^\-|\-$!i, "")
|
||||||
|
|
||||||
slug.downcase! unless cased
|
slug.downcase! unless cased
|
||||||
|
Jekyll.logger.warn("Warning:", "Empty `slug` generated for '#{string}'.") if slug.empty?
|
||||||
slug
|
slug
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -282,6 +282,11 @@ class TestUtils < JekyllUnitTest
|
||||||
Utils.slugify("The _config.yml file?", :mode => "none", :cased => true)
|
Utils.slugify("The _config.yml file?", :mode => "none", :cased => true)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "records a warning in the log if the returned slug is empty" do
|
||||||
|
expect(Jekyll.logger).to receive(:warn)
|
||||||
|
assert_equal "", Utils.slugify("💎")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "The \`Utils.titleize_slug\` method" do
|
context "The \`Utils.titleize_slug\` method" do
|
||||||
|
|
Loading…
Reference in New Issue