diff --git a/CHANGES b/CHANGES index 855dbf211e7..e630303e2a7 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Dependencies Incompatible changes -------------------- +* #6462: double backslashes in domain directives are no longer replaced by + single backslashes. + Deprecated ---------- @@ -20,6 +23,7 @@ Bugs fixed * #1125: html theme: scrollbar is hard to see on classic theme and macOS * #5502: linkcheck: Consider HTTP 503 response as not an error * #6439: Make generated download links reproducible +* #6462: keep backslahes in domain directives verbatim Testing -------- diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py index 13f48e82757..8ebf0b32718 100644 --- a/sphinx/directives/__init__.py +++ b/sphinx/directives/__init__.py @@ -92,8 +92,7 @@ def get_signatures(self) -> List[str]: Backslash-escaping of newlines is supported. """ lines = nl_escape_re.sub('', self.arguments[0]).split('\n') - # remove backslashes to support (dummy) escapes; helps Vim highlighting - return [strip_backslash_re.sub(r'\1', line.strip()) for line in lines] + return [line.strip() for line in lines] def handle_signature(self, sig: str, signode: desc_signature) -> Any: """