Skip to content

Commit

Permalink
Fix Bug: blog title won't submit with weird characters (#922)
Browse files Browse the repository at this point in the history
* fix: blog title won't submit with weird characters

* include hyphens
  • Loading branch information
Tguntenaar authored Aug 14, 2024
1 parent b74195d commit fcce535
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ function transformString(str) {
// Replace spaces with hyphens
const transformedStr = lowerCaseStr.replace(/ /g, "-");

// Replace anything that is not a letter or a number with an empty string
const cleanedStr = transformedStr.replace(/[^a-z0-9A-Z-]/g, "");

// Return the transformed string
return transformedStr;
return cleanedStr;
}

const handleOnSubmit = (v, isEdit) => {
Expand Down

0 comments on commit fcce535

Please sign in to comment.