diff --git a/renderer/funcmap.go b/renderer/funcmap.go index ee907b37..bc136b4c 100644 --- a/renderer/funcmap.go +++ b/renderer/funcmap.go @@ -85,7 +85,8 @@ func genCaptcha() string { } func markdown(text string) string { - unsafe := blackfriday.Run([]byte(text)) + sanitized := strings.Replace(text, "\r\n", "\n", -1) + unsafe := blackfriday.Run([]byte(sanitized)) return string(bluemonday.UGCPolicy().SanitizeBytes(unsafe)) } func version() string { diff --git a/templates/responses_show.html.tpl b/templates/responses_show.html.tpl index 985de506..aba19ade 100644 --- a/templates/responses_show.html.tpl +++ b/templates/responses_show.html.tpl @@ -28,6 +28,16 @@ La gara รจ sempre attiva. {{end}} + {{if not (.Data.Contest.Date|zeroTime)}} +
Prima visualizzazione
+
+ {{if not (.Data.StartTime|zeroTime)}} + Giorno {{.Data.StartTime|prettyDate}} alle ore {{.Data.StartTime|convertTime}} + {{else}} + Il partecipante non ha ancora visualizzato la prova. + {{end}} +
+ {{end}} {{if $isAdmin}}
Ordine delle domande
{{.Data.QuestionsOrder}}
@@ -50,6 +60,30 @@ {{end}} + {{if .Data.Contest.Description}} +

Descrizione della prova

+
+
+ {{.Data.Contest.Description|markdown|html}} +
+
+ {{end}} + + {{if or $isParticipant}} +
+
+

Suggerimenti

+

+ Per iniziare o riprendere la gara clicca sul pulsante a destra. + + + Vai alla gara! + +

+
+
+ {{end}} + {{if $isAdmin}}