guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#62202] [PATCH 20/21] import: utils: Rule out texinfo common syntax


From: Nicolas Graves
Subject: [bug#62202] [PATCH 20/21] import: utils: Rule out texinfo common syntax from @ escape.
Date: Wed, 15 Mar 2023 13:51:29 +0100

---
 guix/import/juliahub.scm | 5 +----
 guix/import/utils.scm    | 8 +++++++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/guix/import/juliahub.scm b/guix/import/juliahub.scm
index 06574db724..0d3f89ad61 100644
--- a/guix/import/juliahub.scm
+++ b/guix/import/juliahub.scm
@@ -197,10 +197,7 @@ (define %juliahub-beautify-description-rules
     (li           . ,(lambda args
                        `("\n@item" ,@(cdr args))))
     (code         . ,(lambda args
-                       (string-append
-                        "@code{"
-                        (string-join (cdr args) " ")
-                        "}")))
+                       `("@code{" ,@(cdr args) "}")))
     (*text*       . ,(lambda (tag x) x))
     (*default*    . ,(lambda (tag . body)
                        (cons tag body)))))
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 171dca54e8..5ed1dfd815 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -376,7 +376,13 @@ (define* (beautify-description description #:optional 
(length 80))
                    (cut string-trim-both <> #\')
                    ;; Escape single @ to prevent it from being understood as
                    ;; invalid Texinfo syntax.
-                   (cut regexp-substitute/global #f "@" <> 'pre "@@" 'post)))))
+                   (lambda (word)
+                     (if
+                      (member word '("@itemize" "@item" "@end" "@quotation"
+                                     "@enumerate" "@code" "@code{"))
+                      word
+                      ((cut regexp-substitute/global
+                            #f "@" <> 'pre "@@" 'post) word)))))))
          (words
           (string-tokenize (string-trim-both description)
                            (char-set-complement
-- 
2.39.2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]