bring back pretty JSON.

This commit is contained in:
fiatjaf
2023-09-13 21:13:37 -03:00
parent 0754a46405
commit daf83b136c
2 changed files with 5 additions and 1 deletions

View File

@@ -307,6 +307,9 @@ func render(w http.ResponseWriter, r *http.Request) {
content = renderInlineMentions(basicFormatting(html.EscapeString(content)))
}
// pretty JSON
eventJSON, _ := json.MarshalIndent(event, "", " ")
params := map[string]any{
"createdAt": createdAt,
"modifiedAt": modifiedAt,
@@ -323,6 +326,7 @@ func render(w http.ResponseWriter, r *http.Request) {
"subject": subject,
"description": description,
"event": event,
"eventJSON": string(eventJSON),
"content": content,
"titleizedContent": titleize(content),
"textImageURL": textImageURL,

View File

@@ -18,5 +18,5 @@
<div class="field {{if not ( or (eq .type "other") (eq .type "address"))}}advanced{{end}} boxed">
<div class="label">Event JSON</div>
<div class="json">{{.event}}</div>
<div class="json">{{.eventJSON}}</div>
</div>