retain output structure in response

This commit is contained in:
Rob Loranger 2019-12-19 08:28:06 -08:00
parent 26d906ae92
commit dae65b7d1f
No known key found for this signature in database
GPG Key ID: D6F1633A4F0903B8
1 changed files with 7 additions and 1 deletions

View File

@ -258,5 +258,11 @@ func handleRenderMarkdown(app *App, w http.ResponseWriter, r *http.Request) erro
return ErrBadJSON
}
return impart.WriteSuccess(w, applyMarkdown([]byte(in.RawBody), in.BaseURL, app.cfg), http.StatusOK)
out := struct {
Body string `json:"body"`
}{
Body: applyMarkdown([]byte(in.RawBody), in.BaseURL, app.cfg),
}
return impart.WriteSuccess(w, out, http.StatusOK)
}