all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Attila Lendvai <attila@lendvai.name>, 55242@debbugs.gnu.org
Subject: [bug#55242] [PATCH 05/10] guix: import: go: Harden sxml->texi conversion.
Date: Tue, 03 May 2022 18:32:58 +0200	[thread overview]
Message-ID: <646875155b87dbd5bff76f1f3ddbbdb50abd627f.camel@telenet.be> (raw)
In-Reply-To: <20220503114301.9524-5-attila@lendvai.name>

[-- Attachment #1: Type: text/plain, Size: 1845 bytes --]

Attila Lendvai schreef op di 03-05-2022 om 13:42 [+0200]:
>    (sxml-match sxml-node
> -              ((strong ,text)
> -               (format #f "@strong{~a}" text))
> -              ((a (@ (href ,url)) ,text)
> -               (format #f "@url{~a,~a}" url text))
> -              ((code ,text)
> -               (format #f "@code{~a}" text))
> -              (,something-else something-else)))
> +    ((strong ,text)
> +     (format #f "@strong{~a}" text))

Do we know for sure here that 'text' is actually a string?  What if the
input was (strong (em (a (href "http://super") "Super") emphasis")?

> +    ((a (@ (href ,url)) ,body)
> +     ;; Examples: image in the url: github.com/go-openapi/jsonpointer
> +     ;; (code ...) in the URL body: github.com/mwitkow/go-conntrack
> +     (if (string? body)
> +         (format #f "@url{~a,~a}" url body)
> +         (sxml-match body
> +                     ((code ,text)
> +                      (format #f "@url{~a,~a}" url (sxml->texi body)))
> +                     (,_

I'm not familiar enough with sxml to be sure, but maybe the , can be
removed here.

> +                      (format #f "@url{~a}" url)))))
> +    ((code ,text)
> +     (format #f "@code{~a}" text))
> +    (,something-else
> +     ;; Example: @ in the description: github.com/ethersphere/langos
> +     (if (string? something-else)
> +         (string-replace-substring something-else
> +                                   "@" "@@")
> +         something-else))))

Anyway, more cases are nice, but I recommend tests.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-05-03 16:34 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 11:16 [bug#55242] [PATCH 01/10] guix: import: Print the number of packages at the end Attila Lendvai
2022-05-03 11:42 ` [bug#55242] [PATCH 02/10] guix: import: go: Rename go.pkg.dev-info to pkg.go.dev-info Attila Lendvai
2022-05-03 11:42   ` [bug#55242] [PATCH 03/10] guix: import: go: Add mockup logging facility Attila Lendvai
2022-05-03 16:23     ` Maxime Devos
2022-06-14 19:46     ` [bug#55242] [PATCH 01/10] guix: import: Print the number of packages at the end Maxim Cournoyer
2022-05-03 11:42   ` [bug#55242] [PATCH 04/10] guix: import: go: Fix the interpretation of the replace directive Attila Lendvai
2022-05-03 16:25     ` Maxime Devos
2022-05-03 16:26     ` Maxime Devos
2022-05-03 16:27     ` Maxime Devos
2022-05-03 16:28     ` Maxime Devos
2022-05-03 11:42   ` [bug#55242] [PATCH 05/10] guix: import: go: Harden sxml->texi conversion Attila Lendvai
2022-05-03 16:32     ` Maxime Devos [this message]
2022-05-03 11:42   ` [bug#55242] [PATCH 06/10] guix: import: go: Add a local duplicate of http-fetch Attila Lendvai
2022-05-03 11:42   ` [bug#55242] [PATCH 07/10] guix: import: go: More resilience wrt network errors; add logging Attila Lendvai
2022-05-03 16:12     ` Maxime Devos
2022-05-03 17:00       ` Attila Lendvai
2022-05-03 17:38         ` Maxime Devos
2022-05-09 12:34           ` Attila Lendvai
2022-05-09 17:45             ` Maxime Devos
2022-05-09 20:02               ` Attila Lendvai
2022-05-09 20:08                 ` Maxime Devos
2022-05-03 16:17     ` Maxime Devos
2022-05-03 16:36     ` Maxime Devos
2022-05-03 16:37     ` Maxime Devos
2022-05-03 11:42   ` [bug#55242] [PATCH 08/10] guix: import: go: Modules in a subdir and prefixed tags Attila Lendvai
2022-05-03 16:42     ` Maxime Devos
2022-05-03 16:48     ` Maxime Devos
2022-05-03 16:50     ` Maxime Devos
2022-05-09 12:50       ` Attila Lendvai
2022-05-03 16:51     ` Maxime Devos
2022-05-03 16:53     ` Maxime Devos
2022-05-03 16:55     ` Maxime Devos
2022-05-03 16:56     ` Maxime Devos
2022-05-03 16:59     ` Maxime Devos
2022-05-03 17:00     ` Maxime Devos
2022-05-03 17:01     ` Maxime Devos
2022-05-03 11:43   ` [bug#55242] [PATCH 09/10] guix: import: go: module-name -> module-path to be consistent Attila Lendvai
2022-05-03 11:43   ` [bug#55242] [PATCH 10/10] guix: import: go: Better handling of /v2 in the module path Attila Lendvai
2022-05-09 20:39     ` Maxime Devos
2022-05-03 16:22   ` [bug#55242] [PATCH 02/10] guix: import: go: Rename go.pkg.dev-info to pkg.go.dev-info Maxime Devos
2022-05-03 16:21 ` [bug#55242] [PATCH 01/10] guix: import: Print the number of packages at the end Maxime Devos
2022-05-03 17:29 ` Maxime Devos
2022-05-09 12:37   ` Attila Lendvai
2022-05-14  7:09 ` Maxime Devos
2022-05-14  7:15 ` Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=646875155b87dbd5bff76f1f3ddbbdb50abd627f.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=55242@debbugs.gnu.org \
    --cc=attila@lendvai.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.