summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2026-05-09 08:56:40 +0200
committerJonathan Corbet <corbet@lwn.net>2026-05-15 08:01:48 -0600
commit083f0b10f540ae16009a26cd441d7dc6f94e1c13 (patch)
tree3c8899758bc56b7a5099fd6b4497c0d9a27caad7 /Documentation
parent1aac8eff9a9e6d6e23909bd4aaa583a98a8f850a (diff)
docs: maintainers_include: properly handle file patterns
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@meta.com> Fixes: 420849332f9f ("get_maintainer: add ** glob pattern support") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Message-ID: <89127706fb3493d00ecb21e528c8a27081e5ed40.1777987027.git.mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <abd5112fea4dd480f5e72ba46fe60c2463862829.1778309595.git.mchehab+huawei@kernel.org>
Diffstat (limited to 'Documentation')
-rwxr-xr-xDocumentation/sphinx/maintainers_include.py26
1 files 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: