mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-12-16 06:25:31 +00:00
Parsing upon deserialising
This commit is contained in:
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"github.com/Theodor-Springmann-Stiftung/lenz-web/helpers/functions"
|
||||
"github.com/Theodor-Springmann-Stiftung/lenz-web/xmlmodels"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
@@ -22,8 +21,16 @@ func GetLetter(c *fiber.Ctx) error {
|
||||
}
|
||||
np := lib.NextPrev(meta)
|
||||
|
||||
parsed := functions.ParseText(lib, meta)
|
||||
letterData := lib.Letters.Item(letter)
|
||||
if letterData == nil {
|
||||
return c.SendStatus(fiber.StatusNotFound)
|
||||
}
|
||||
|
||||
html := ""
|
||||
if state := letterData.HTML.Data(); state != nil {
|
||||
html = state.String()
|
||||
}
|
||||
tradition := lib.Traditions.Item(letter)
|
||||
|
||||
return c.Render("/brief/", fiber.Map{"meta": meta, "text": parsed, "tradition": tradition, "next": np.Next, "prev": np.Prev})
|
||||
return c.Render("/brief/", fiber.Map{"meta": meta, "text": html, "tradition": tradition, "next": np.Next, "prev": np.Prev})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user