slugger icon indicating copy to clipboard operation
slugger copied to clipboard

Breaking changes in 0.3

Open axelson opened this issue 7 years ago • 4 comments

It looks like there's some breaking changes in 0.3. I haven't looked into them too fully yet but some of my tests are now breaking. Here's an example FunctionClauseError I'm getting.

     ** (FunctionClauseError) no function clause matching in Regex.replace/4

     The following arguments were given to Regex.replace/4:

         # 1
         ~r/['’]s/u

         # 2
         nil

         # 3
         "s"

         # 4
         [global: nil]

     Attempted function clauses (showing 2 out of 2):

         def replace(regex, string, replacement, options) when is_binary(string) and is_binary(replacement) and is_list(options)
         def replace(regex, string, replacement, options) when is_binary(string) and is_function(replacement) and is_list(options)

     code: conn = post conn, api_community_path(conn, :create), %{community: community_params}
     stacktrace:
       (elixir) lib/regex.ex:595: Regex.replace/4
       (slugger) lib/slugger.ex:40: Slugger.slugify/2

Is there any documentation of the breaking changes?

axelson avatar Oct 12 '18 02:10 axelson

Have an issue with this character too. README promises only A-Za-z0-9 alphabet is possible, but it's not:

iex(2)> Slugger.slugify_downcase "Children´s Playroom"
"children´s-playroom"
iex(3)> 

ssbb avatar Nov 26 '18 01:11 ssbb

For comparison here is the correct output from version 0.2.0:

iex(2)> Slugger.slugify_downcase "Children´s Playroom"
"children-s-playroom"

axelson avatar Nov 26 '18 20:11 axelson

@h4cc any chance you could take a look at this? Would you accept a PR to bring back the old behavior?

axelson avatar Jan 30 '19 00:01 axelson

It looks like this is the change that broke things: https://github.com/h4cc/slugger/commit/570c95ed171115d4d1d534060bb245760a908299

axelson avatar Jan 30 '19 00:01 axelson