Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Slugify and replace space with hyphens in page path #74

Closed
wants to merge 1 commit into from

Conversation

manusajith
Copy link
Contributor

Ref: #67

This change replaces spaces in slug with hyphens, but the bug still remains, as the redirection is handled in the front end now. We should either update backend to return the updated changeset or should update frontend with the same logic to replace spaces with hyphens

@yulolimum
Copy link
Member

@jamonholmgren

@jamonholmgren
Copy link
Member

@manusajith I missed this, sorry about that!

We already have some code to handle slugification, so we should unify the two:

defp parameterize(str) do
str = Regex.replace(~r/[^a-z0-9\-\s]/i, str, "")
Regex.split(~r/\%20|\s/, str)
|> Enum.join("-")
|> String.downcase
end

Otherwise, 👍 on this change.

Could you also write a test or two?

@jamonholmgren
Copy link
Member

@robinheinze and/or @mlaco Let's chat about this at some point.

@silasjmatson
Copy link
Contributor

Closing in favor of #111

Thanks for the help, @manusajith!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants