fehlerbehebung

This commit is contained in:
xoy 2023-01-29 16:33:16 +01:00
parent 6df99b809c
commit fe61a79141
2 changed files with 9 additions and 5 deletions

12
html.go
View File

@ -77,9 +77,9 @@ func htmlReplacer(input string, activePage string) string {
break break
} }
tempA = htmlElement("h2", Event.title, "") tempA = htmlElement("h2", htmlClean(Event.title), "")
tempA += htmlElement("p", Event.description, "") tempA += htmlElement("p", htmlClean(Event.description), "")
tempA += htmlElement("p", Event.date, "") tempA += htmlElement("p", htmlClean(Event.date), "")
tempB += htmlElement("div", tempA, "class=\"event\"") tempB += htmlElement("div", tempA, "class=\"event\"")
} }
output = strings.ReplaceAll(output, "!EVENTS", htmlElement("div", tempB, "class=\"eventList\"")) output = strings.ReplaceAll(output, "!EVENTS", htmlElement("div", tempB, "class=\"eventList\""))
@ -96,3 +96,9 @@ func htmlReplacer(input string, activePage string) string {
return output return output
} }
func htmlClean(htmlString string) string {
htmlString = strings.ReplaceAll(htmlString, "<", "[")
htmlString = strings.ReplaceAll(htmlString, ">", "]")
return htmlString
}

View File

@ -79,9 +79,7 @@ func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string)
errorPanic(err) errorPanic(err)
} }
logger("event added!") logger("event added!")
logger("----------------HANDLE IMAGES----------------")
handleImages() handleImages()
logger("----------------HANDLE END----------------")
} else { } else {
logger("event not added!") logger("event not added!")
} }