Skip to content

Commit 98f51c4

Browse files
mchehabJonathan Corbet
authored andcommitted
docs: kdoc: Fix pdfdocs build for tools
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/ Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <2fff8ef1d0d64e8b68f15f5c07613f302d773855.1769500383.git.mchehab+huawei@kernel.org>
1 parent 12ea2cf commit 98f51c4

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tools/lib/python/kdoc/kdoc_re.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,18 @@ def search(self, regex, line):
228228
yield line[t[0]:t[2]]
229229

230230
def sub(self, regex, sub, line, count=0):
231-
"""
231+
r"""
232232
This is similar to re.sub:
233233
234234
It matches a regex that it is followed by a delimiter,
235235
replacing occurrences only if all delimiters are paired.
236236
237-
if r'\1' is used, it works just like re: it places there the
238-
matched paired data with the delimiter stripped.
237+
if the sub argument contains::
238+
239+
r'\1'
240+
241+
it will work just like re: it places there the matched paired data
242+
with the delimiter stripped.
239243
240244
If count is different than zero, it will replace at most count
241245
items.

0 commit comments

Comments
 (0)