]> Sergey Matveev's repositories - linksexp.git/commitdiff
Escape Texinfo-related feeds lists
authorSergey Matveev <stargrave@stargrave.org>
Mon, 12 Jul 2021 08:08:57 +0000 (11:08 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 12 Jul 2021 09:46:25 +0000 (12:46 +0300)
main.go

diff --git a/main.go b/main.go
index 875291dfc7263187959d7ff589fe88f93673cedc..ffa32468ca023ed5a5dd8959ae49ce8a72506690 100644 (file)
--- 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,
+                                       )
                                }
                        }
                }