Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xbpk3t committed Jul 21, 2024
1 parent 8627488 commit 98f3964
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions yaml2md/cmd/goods.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ var goodsCmd = &cobra.Command{
mark = "~~"
}
if gi.Goods[0].Des != "" {
res.WriteString(fmt.Sprintf("\n\n<details>\n<summary>%s[%s](%s)%s</summary>\n\n%s\n\n</details>\n\n", mark, gi.Goods[0].Name, gi.Goods[0].URL, mark, gi.Goods[0].Des))
if gi.Goods[0].URL == "" {
res.WriteString(fmt.Sprintf("\n\n<details>\n<summary>%s%s%s</summary>\n\n%s\n\n</details>\n\n", mark, gi.Goods[0].Name, mark, gi.Goods[0].Des))
} else {
res.WriteString(fmt.Sprintf("\n\n<details>\n<summary>%s[%s](%s)%s</summary>\n\n%s\n\n</details>\n\n", mark, gi.Goods[0].Name, gi.Goods[0].URL, mark, gi.Goods[0].Des))
}
} else {
res.WriteString(fmt.Sprintf("- %s%s%s\n", mark, gi.Goods[0].Name, mark))
}
Expand All @@ -104,7 +108,12 @@ var goodsCmd = &cobra.Command{
mark = "~~"
}
if g.Des != "" {
res.WriteString(fmt.Sprintf("\n\n<details>\n<summary>%s[%s](%s)%s</summary>\n\n%s\n\n</details>\n\n", mark, g.Name, g.URL, mark, g.Des))
if g.URL == "" {
res.WriteString(fmt.Sprintf("\n\n<details>\n<summary>%s%s%s</summary>\n\n%s\n\n</details>\n\n", mark, g.Name, mark, g.Des))
} else {
res.WriteString(fmt.Sprintf("\n\n<details>\n<summary>%s[%s](%s)%s</summary>\n\n%s\n\n</details>\n\n", mark, g.Name, g.URL, mark, g.Des))
}

} else {
res.WriteString(fmt.Sprintf("- %s%s%s\n", mark, g.Name, mark))
}
Expand Down

0 comments on commit 98f3964

Please sign in to comment.