From 316451de8193611a00b4611b13ea77d0809caea7 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Fri, 12 Jul 2024 19:02:44 +0200 Subject: [PATCH] Add `docutils` type, to warnings originating from docutils (#12550) As per other warning types, this helps users to better understand the root of the problem. --- sphinx/util/docutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx/util/docutils.py b/sphinx/util/docutils.py index 3e018dd96..32c303ed2 100644 --- a/sphinx/util/docutils.py +++ b/sphinx/util/docutils.py @@ -330,11 +330,11 @@ class WarningStream: def write(self, text: str) -> None: matched = report_re.search(text) if not matched: - logger.warning(text.rstrip("\r\n")) + logger.warning(text.rstrip("\r\n"), type="docutils") else: location, type, level = matched.groups() message = report_re.sub('', text).rstrip() - logger.log(type, message, location=location) + logger.log(type, message, location=location, type="docutils") class LoggingReporter(Reporter):