mirror of
https://github.com/SphericalKat/medium.rip.git
synced 2024-12-27 10:05:58 +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 := ""
|
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 := ""
|
||||||
|
Loading…
Reference in New Issue
Block a user