mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH] docs: kdoc: Fix pdfdocs build for tools
Date: Sat, 24 Jan 2026 15:56:46 +0900	[thread overview]
Message-ID: <281c27c9-1c0a-4cdc-9250-b1fb6388c14e@gmail.com> (raw)
In-Reply-To: <1a60aea3155a2e7c5e7bb004952739652407fb8c.1769233717.git.mchehab+huawei@kernel.org>

On Sat, 24 Jan 2026 06:48:41 +0100, Mauro Carvalho Chehab wrote:
> the "\1" inside a docstring requires proper scaping to not be
> considered a hex character and break the build.
> 
> Reported-by: Akira Yokosawa <akiyks@gmail.com>
> Closes: https://lore.kernel.org/linux-doc/63e99049-cc72-4156-83af-414fdde34312@gmail.com/

This doesn't look like working as expected.

I see:

    if r’1’ is used ...

in both the HTML and PDF outputs.  I think what you expect is:

    if r’\1’ is used ...

> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  tools/lib/python/kdoc/kdoc_re.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/lib/python/kdoc/kdoc_re.py b/tools/lib/python/kdoc/kdoc_re.py
> index 2816bd9f90f8..dae5a9136fbf 100644
> --- a/tools/lib/python/kdoc/kdoc_re.py
> +++ b/tools/lib/python/kdoc/kdoc_re.py
> @@ -228,7 +228,7 @@ class NestedMatch:
>              yield line[t[0]:t[2]]
>  
>      def sub(self, regex, sub, line, count=0):
> -        """
> +        r"""
>          This is similar to re.sub:
>  
>          It matches a regex that it is followed by a delimiter,

To get the expected "\1", I guess you also need:

@@ -234,7 +234,7 @@ class NestedMatch:
         It matches a regex that it is followed by a delimiter,
         replacing occurrences only if all delimiters are paired.
 
-        if r'\1' is used, it works just like re: it places there the
+        if r'\\1' is used, it works just like re: it places there the
         matched paired data with the delimiter stripped.
 
         If count is different than zero, it will replace at most count

as well.  No?

Thanks, Akira




  reply	other threads:[~2026-01-24  6:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-24  5:48 Mauro Carvalho Chehab
2026-01-24  6:56 ` Akira Yokosawa [this message]
2026-01-24  7:42   ` Mauro Carvalho Chehab

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=281c27c9-1c0a-4cdc-9250-b1fb6388c14e@gmail.com \
    --to=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rdunlap@infradead.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®