From a803c543ca637462dc575afc5cd26c0a7ee6b461 Mon Sep 17 00:00:00 2001
From: Sergey Matveev <stargrave@stargrave.org>
Date: Mon, 12 Jul 2021 11:08:57 +0300
Subject: [PATCH] Escape Texinfo-related feeds lists

---
 main.go | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/main.go b/main.go
index 875291d..ffa3246 100644
--- a/main.go
+++ b/main.go
@@ -148,7 +148,10 @@ func main() {
 			}
 			fmt.Printf(
 				"  @item %d @tab @url{%s,, %s} %s @tab %s @tab\n",
-				n, ent["URL"][0], ent["Title"][0], note,
+				n,
+				strings.ReplaceAll(ent["URL"][0], "@", "@@"),
+				strings.ReplaceAll(ent["Title"][0], "@", "@@"),
+				note,
 				strings.Join(catsOther, ", "),
 			)
 			switch feeds := ent["Feed"]; len(feeds) {
@@ -161,7 +164,10 @@ func main() {
 				)
 			default:
 				for i, feed := range feeds {
-					fmt.Printf("    @url{%s, feed%d}\n", feed, i)
+					fmt.Printf(
+						"    @url{%s, feed%d}\n",
+						strings.ReplaceAll(feed, "@", "@@"), i,
+					)
 				}
 			}
 		}
-- 
2.52.0