summaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-04-01 18:37:47 +0200
committerxengineering <me@xengineering.eu>2023-04-01 18:37:47 +0200
commit43e6305c45c6365288c1f512702f49ba2e52e941 (patch)
tree6d9b06c423a3baa1368e1b23fd80ff3c24fe66c5 /handler.go
parent88107366bce6b7f7c788171a18c40ad102904ff4 (diff)
downloadceres-43e6305c45c6365288c1f512702f49ba2e52e941.tar
ceres-43e6305c45c6365288c1f512702f49ba2e52e941.tar.zst
ceres-43e6305c45c6365288c1f512702f49ba2e52e941.zip
Improve user interface
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/handler.go b/handler.go
index aa231e5..46e1b02 100644
--- a/handler.go
+++ b/handler.go
@@ -111,6 +111,9 @@ func recipeGet(w http.ResponseWriter, r *http.Request) {
return
}
+ titleRegex := regexp.MustCompile(`\# .*`)
+ elements[0].DescriptionMarkdown = titleRegex.ReplaceAllString(elements[0].DescriptionMarkdown, "")
+
// render markdown
var buf bytes.Buffer
goldmark.Convert([]byte(elements[0].DescriptionMarkdown), &buf)