diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2025-02-11 22:11:45 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2025-02-11 22:13:10 +0100 |
commit | 729bfe368973f57a88ab132c23ca103a58bee78a (patch) | |
tree | a4657f7fd91a6a080a22a22552b132a8e9c795f1 /guix/import | |
parent | 36c9996b75ee2163a5081d4b10530f9388d420da (diff) |
import/utils: Wrap terms starting with @ in descriptions.
* tests/import-utils.scm ("beautify-description: escape @stuff"): Add test.
* guix/import/utils.scm (beautify-description): Also wrap terms in @code{...}
that start with an escaped @.
Change-Id: I424f626635b821af6f4c16c97b8724cdaf99de45
Diffstat (limited to 'guix/import')
-rw-r--r-- | guix/import/utils.scm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 646482eb4a..c6b7341f2b 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -342,12 +342,12 @@ LENGTH characters." ;; Escape single @ to prevent it from being understood as ;; invalid Texinfo syntax. (cut regexp-substitute/global #f "@" <> 'pre "@@" 'post) - ;; Wrap camelCase or PascalCase words or text followed - ;; immediately by "()" in @code{...}. + ;; Wrap camelCase, PascalCase words, text followed + ;; immediately by "()", or text starting with "@@" in @code{...}. (lambda (word) (let ((pattern (make-regexp - "([A-Z][a-z]+[A-Z]|[a-z]+[A-Z]|.+\\(\\))"))) + "((@@)?[A-Z][a-z]+[A-Z]|(@@)?[a-z]+[A-Z]|(@@)?.+\\(\\))"))) (match (list-matches pattern word) (() word) ((m . rest) |