summaryrefslogtreecommitdiff
path: root/sphinx/directives
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-01-08 22:19:07 +0100
committerGeorg Brandl <georg@python.org>2011-01-08 22:19:07 +0100
commit243976d4d16f61bf0a8a9a22e5f478e352d08579 (patch)
treefa84657881fc3f668b25526cfc21e779fb834cae /sphinx/directives
parent4cdb98ae16e11cd3a778ad222888850716b124ea (diff)
downloadsphinx-243976d4d16f61bf0a8a9a22e5f478e352d08579.tar.gz
Fix backslash replacement regex.
Diffstat (limited to 'sphinx/directives')
-rw-r--r--sphinx/directives/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py
index f11a4059..6e0300ab 100644
--- a/sphinx/directives/__init__.py
+++ b/sphinx/directives/__init__.py
@@ -33,7 +33,7 @@ except AttributeError:
# 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):
@@ -63,7 +63,7 @@ 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):
"""