[PATCH v3 07/13] docs: maintainers_include: properly handle file patterns

From: Mauro Carvalho Chehab

Date: Sat May 09 2026 - 03:00:54 EST


handling asterisks inside file patterns atdescription part is
problematic, as ReST has special meaning for them. Due to
that, convert such patterns to literal strings.

Reported-by: Matteo Croce <teknoraver@xxxxxxxx>
Fixes: 420849332f9f ("get_maintainer: add ** glob pattern support")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
Message-ID: <89127706fb3493d00ecb21e528c8a27081e5ed40.1777987027.git.mchehab+huawei@xxxxxxxxxx>
---
Documentation/sphinx/maintainers_include.py | 26 ++++++++++-----------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/Documentation/sphinx/maintainers_include.py b/Documentation/sphinx/maintainers_include.py
index ed9cd7b3dc66..5361774b61bc 100755
--- a/Documentation/sphinx/maintainers_include.py
+++ b/Documentation/sphinx/maintainers_include.py
@@ -47,9 +47,6 @@ class MaintainersParser:
self.maintainers = False
self.subsystems = False

- # Field letter to field name mapping.
- self.field_letter = None
-
self.subsystem_name = None

self.app_dir = os.path.abspath(app_dir)
@@ -125,19 +122,22 @@ class MaintainersParser:
self.header += "\n" + line
return

- # Escape the escapes in preformatted text.
- self.header += "| " + self.linkify(line).replace("\\", "\\\\")
-
# Look for and record field letter to field name mappings:
# R: Designated *reviewer*: FullName <address@domain>
- m = re.search(r"\s(\S):\s", line)
+ m = re.match(r"\s+(\S):\s+(\S+)", line)
if m:
- self.field_letter = m.group(1)
+ field = m.group(1)
+ details = m.group(2)
+
+ if field not in self.fields:
+ m = re.search(r"\*([^\*]+)\*", line)
+ if m:
+ self.fields[field] = m.group(1)
+ elif field in ['F', 'N', 'X', 'K']:
+ line = line.replace(details, f'``{details}``')
+
+ self.header += "| " + self.linkify(line)

- if self.field_letter and self.field_letter not in self.fields:
- m = re.search(r"\*([^\*]+)\*", line)
- if m:
- self.fields[self.field_letter] = m.group(1)

def parse_subsystems(self, line):
"""Handle contents of the per-subsystem sections."""
@@ -206,7 +206,7 @@ class MaintainersParser:
#
if field in ['F', 'N', 'X', 'K']:
# But only if not already marked :)
- if not ':doc:' in details:
+ if ':doc:' not in details and "http" not in details:
details = '``%s``' % (details)

if self.subsystem_name not in self.maint_entries:
--
2.54.0