fix img and description

This commit is contained in:
zongor 2024-09-17 19:56:39 -04:00
parent d55d21eb99
commit 2c42d4526a
1 changed files with 6 additions and 2 deletions

View File

@ -4,7 +4,6 @@ import (
"bufio"
"context"
"fmt"
"regexp"
"log"
"os"
"sort"
@ -71,7 +70,12 @@ func main() {
description := fixHtml(item.Description)
content := fixHtml(item.Content)
fmt.Printf("<li>\n<h3>\n<a href=\"%s\">\n%s\n</a>\n</h3>\n<h5>\n%s\n</h5>\n<p>\n%s\n</p>\n</li>\n", item.Link, item.Title, description, content)
fmt.Println("<li>")
fmt.Printf("<h3><a href=\"%s\">%s</a></h3>\n", item.Link, item.Title)
if description != "" {fmt.Printf("<h5>%s</h5>\n", description)}
if content != "" {fmt.Printf("<p>%s</p>\n", content)}
if item.Image != nil {fmt.Printf("<img src=\"%s\" height=\"400\">\n", item.Image.URL)}
fmt.Println("</li>")
}
fmt.Println("</ul>")