diff mbox series

[bug#62202,v3,4/4] import: utils: Rule out texinfo common syntax from @ escape.

Message ID 20231221140142.16523-4-ngraves@ngraves.fr
State New
Headers show
Series [bug#62202,v3,1/4] import: utils: Add function git->origin. | expand

Commit Message

Nicolas Graves Dec. 21, 2023, 2:01 p.m. UTC
---
 guix/import/utils.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 47254539a1..57e4ec0ce7 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -375,7 +375,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  ; Rule out some valid Texinfo syntax.
+                      (member word '("@itemize" "@item" "@end" "@quotation"
+                                     "@enumerate" "@code" "@code{"))
+                      word
+                      ((cut regexp-substitute/global
+                            #f "@" <> 'pre "@@" 'post) word)))
                    ;; Wrap camelCase or PascalCase words in @code{...}.
                    (lambda (word)
                      (let ((pattern (make-regexp "([A-Z][a-z]+[A-Z]|[a-z]+[A-Z])")))