fix(previews): use the first h3 or p element for description

Signed-off-by: Sphericalkat <amolele@gmail.com>
This commit is contained in:
Amogh Lele 2023-05-28 23:56:23 +05:30
parent 3837d07495
commit 00357be73c

View File

@ -30,7 +30,12 @@ func show(c *fiber.Ctx) error {
desc := "" desc := ""
if len(paragraphs) >= 0 { if len(paragraphs) >= 0 {
desc = paragraphs[1].Text for _, p := range paragraphs {
if p.Type == "H3" || p.Type == "P" {
desc = p.Text
break
}
}
} }
imgUrl := "" imgUrl := ""