summaryrefslogtreecommitdiff
path: root/sphinx/directives
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-08-05 16:20:12 +0200
committerGeorg Brandl <georg@python.org>2010-08-05 16:20:12 +0200
commitefd0459770566d40f41e11371ae4fbb5ba1359f1 (patch)
treea5149c2b2f38555682917634ff7ffe03b33a6bff /sphinx/directives
parenta1706a0d3d654e605dda77b2649327bf7066dc02 (diff)
parentac9d5434eefe66b336f7cee5599f253aaea6b70f (diff)
downloadsphinx-efd0459770566d40f41e11371ae4fbb5ba1359f1.tar.gz
merge with 1.0
Diffstat (limited to 'sphinx/directives')
-rw-r--r--sphinx/directives/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py
index 6c03b8e5..48c44178 100644
--- a/sphinx/directives/__init__.py
+++ b/sphinx/directives/__init__.py
@@ -32,6 +32,7 @@ except AttributeError:
# RE to strip backslash escapes
+nl_escape_re = re.compile(r'\\\n')
strip_backslash_re = re.compile(r'\\(?=[^\\])')
@@ -57,10 +58,12 @@ class ObjectDescription(Directive):
"""
Retrieve the signatures to document from the directive arguments. By
default, signatures are given as arguments, one per line.
+
+ 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('', sig.strip())
- for sig in self.arguments[0].split('\n')]
+ return [strip_backslash_re.sub('', line.strip()) for line in lines]
def handle_signature(self, sig, signode):
"""