modrinth / code

The Modrinth monorepo containing all code which powers Modrinth!
https://modrinth.com
Other
921 stars 171 forks source link

Knossos doesn't replace invalid characters when copying from the name field to the url field #1759

Closed jadelily18 closed 1 year ago

jadelily18 commented 1 year ago

Describe the bug

When creating a new project, the apostrophe from the name input is kept in the URL's input. For example, the name of Jade's Mod would be changed to jade's-mod. (Don't mind the pink user style :D)

example of bug

Steps to reproduce

  1. Open the "create a project" modal from the profile dropdown or user page
  2. Type a project name with an apostrophe

Expected behavior

The apostrophe should be removed from the URL slug by default.

Additional context

No response

triphora commented 1 year ago

Apostrophes are allowed in slugs, though

jadelily18 commented 1 year ago

Apostrophes are allowed in slugs, though

but... https://discord.com/channels/734077874708938864/783153806531100673/1047291343011070046

(I'm very confused rn)

Minenash commented 1 year ago

Yeah this says a-zA-Z0-9!@$()`.+,_ with ` being a grave/backtick not an apostrophe.

(and I see that you outdated the comment, but wanted to explain for others reading)

Minenash commented 1 year ago

To broaden the issue's title: Knossos doesn't replace invalid characters when copying from the name field to the url field

(It only lowercases and replaces spaces with dashes.)

image

Geometrically commented 1 year ago

oops I copied the regex from online, it should not allow apostrophe

Minenash commented 1 year ago

Unless there's a regex I missed, none contains an apostrophe in it?