Note that this branch has failing tests under rails 7. These have been addressed in a seperate PR to make the review effort easier https://github.com/tenderlove/rails_autolink/pull/72. If #72 is merged before this one all tests in this branch should be green under Rails 7.
Summary
This PR fixes https://github.com/tenderlove/rails_autolink/issues/52 by including trailing hyphens in URL.
Why
It's valid to have URLs that ends with a
-
. The behaviour before this PR is to exclude it from the part that is auto linked.How
We're adding
-
to the list of characters to not treat as a trailing punctuation.Before this commit
http://www.rubyonrails.com/foo.cgi?trailing_ampersand=value-
Would generate
Instead of
Review notes
Note that this branch has failing tests under rails 7. These have been addressed in a seperate PR to make the review effort easier https://github.com/tenderlove/rails_autolink/pull/72. If #72 is merged before this one all tests in this branch should be green under Rails 7.