mirror of
https://github.com/SphericalKat/medium.rip.git
synced 2024-11-16 11:25:57 +00:00
fix(previews): use the first h3 or p element for description
Signed-off-by: Sphericalkat <amolele@gmail.com>
This commit is contained in:
parent
3837d07495
commit
00357be73c
@ -30,7 +30,12 @@ func show(c *fiber.Ctx) error {
|
||||
|
||||
desc := ""
|
||||
if len(paragraphs) >= 0 {
|
||||
desc = paragraphs[1].Text
|
||||
for _, p := range paragraphs {
|
||||
if p.Type == "H3" || p.Type == "P" {
|
||||
desc = p.Text
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
imgUrl := ""
|
||||
|
Loading…
Reference in New Issue
Block a user