Commits

Georg Brandl  committed 4e2eaa9

Fix backslash replacement regex.

  • Participants
  • Parent commits 6472081

Comments (0)

Files changed (1)

File sphinx/directives/__init__.py

 
 # RE to strip backslash escapes
 nl_escape_re = re.compile(r'\\\n')
-strip_backslash_re = re.compile(r'\\(?=[^\\])')
+strip_backslash_re = re.compile(r'\\(.)')
 
 
 class ObjectDescription(Directive):
         """
         lines = nl_escape_re.sub('', self.arguments[0]).split('\n')
         # remove backslashes to support (dummy) escapes; helps Vim highlighting
-        return [strip_backslash_re.sub('', line.strip()) for line in lines]
+        return [strip_backslash_re.sub(r'\1', line.strip()) for line in lines]
 
     def handle_signature(self, sig, signode):
         """