Skip to content

Commit

Permalink
fix community bangs. fixes #44
Browse files Browse the repository at this point in the history
  • Loading branch information
rystaf committed Jul 24, 2023
1 parent dd4f76a commit 1858f1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ var funcMap = template.FuncMap{
re := regexp.MustCompile(`\s---\s`)
body = re.ReplaceAllString(body, "\n***\n")
// community bangs
body = RegReplace(body, `!([a-zA-Z0-9_]+)@([a-zA-Z0-9\.\-]+)`, `[!$1@$2](/c/$1@$2)`)
body = RegReplace(body, `([^\[])!([a-zA-Z0-9_]+)@([a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+)+)`, `$1[!$2@$3](/c/$2@$3)`)
if err := md.Convert([]byte(body), &buf); err != nil {
fmt.Println(err)
return template.HTML(body)
Expand Down

0 comments on commit 1858f1a

Please sign in to comment.