Fix post title generation
This commit is contained in:
parent
c40a7fab26
commit
92e479457c
2 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Text.RegularExpressions;
|
||||
using Website.Data.States;
|
||||
|
||||
namespace Website.Models
|
||||
|
@ -29,7 +30,7 @@ namespace Website.Models
|
|||
public int UserId { get; private set; }
|
||||
|
||||
private void GenerateUrl() {
|
||||
Url = Title.Replace(' ', '-');
|
||||
Url = Regex.Replace(Title, @"[^a-zA-Z0-9\.]+", "-").ToLower();
|
||||
}
|
||||
|
||||
public void UpdateTitle(string title) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue