yak(behavior-tests-blogex-public-api-and-router-plumbing-q1fb): behavior tests: blogex public API and router plumbing
This commit is contained in:
@@ -232,10 +232,10 @@ defmodule Blogex.LinkValidator do
|
||||
@doc false
|
||||
@spec slug_end(String.t()) :: integer()
|
||||
defp slug_end(str) do
|
||||
case String.split(str, ["?", "#"], parts: 2) do
|
||||
[slug | _] -> String.length(slug)
|
||||
_ -> String.length(str)
|
||||
end
|
||||
# `String.split/3` always returns a non-empty list whose head is a binary,
|
||||
# so there is no empty/other case to handle here.
|
||||
[slug | _] = String.split(str, ["?", "#"], parts: 2)
|
||||
String.length(slug)
|
||||
end
|
||||
|
||||
@doc false
|
||||
|
||||
Reference in New Issue
Block a user