Merge pull request 'Fix archive cmd panic on short content (#9)' (#34) from fix/archive-cmd-short-content into main
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled
CI / vet (push) Has been cancelled

This commit was merged in pull request #34.
This commit is contained in:
2026-02-15 16:18:46 +00:00

View File

@@ -106,6 +106,15 @@ func main() {
return err
}
content := ""
if article.Content != "" {
if len(article.Content) > 32 {
content = article.Content[:32] + "..."
} else {
content = article.Content
}
}
fmt.Println("Title:", article.Title)
fmt.Println("Byline:", article.Byline)
fmt.Println("Site:", article.SiteName)
@@ -113,7 +122,7 @@ func main() {
fmt.Println("Excerpt:", article.Excerpt)
fmt.Println("Length:", article.Length)
fmt.Println("Lang:", article.Lang)
fmt.Println("Content:", article.Content[:32]+"...")
fmt.Println("Content:", content)
fmt.Println("TextContent:", article.TextContent)
return nil
},