summaryrefslogtreecommitdiff
path: root/sphinx/roles.py
diff options
context:
space:
mode:
authorgeorg.brandl <devnull@localhost>2008-07-18 22:55:36 +0000
committergeorg.brandl <devnull@localhost>2008-07-18 22:55:36 +0000
commit31075afed9f8fa008a3ed2a9ff0d7ed024ff8564 (patch)
tree1dc24530c825039c6e2c0cfe649847b274241a56 /sphinx/roles.py
parent7ab43cdfa391f4d647228378a8b2a252529697d2 (diff)
downloadsphinx-31075afed9f8fa008a3ed2a9ff0d7ed024ff8564.tar.gz
Merged revisions 64808,65013,65076,65100-65101,65119,65121-65123 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x ........ r64808 | georg.brandl | 2008-07-08 21:39:33 +0200 (Tue, 08 Jul 2008) | 2 lines Allow relocation of source and doctree dir. ........ r65013 | georg.brandl | 2008-07-16 15:25:30 +0200 (Wed, 16 Jul 2008) | 2 lines Remove curious quote. ........ r65076 | georg.brandl | 2008-07-17 22:43:01 +0200 (Thu, 17 Jul 2008) | 2 lines Add a test for sphinx.quickstart. ........ r65100 | georg.brandl | 2008-07-18 14:41:54 +0200 (Fri, 18 Jul 2008) | 2 lines Fix phony targets. ........ r65101 | georg.brandl | 2008-07-18 14:55:03 +0200 (Fri, 18 Jul 2008) | 2 lines Fix problems in "make check". ........ r65119 | georg.brandl | 2008-07-18 23:06:42 +0200 (Fri, 18 Jul 2008) | 2 lines Emit a more precise error message in autodoc. ........ r65121 | georg.brandl | 2008-07-18 23:41:35 +0200 (Fri, 18 Jul 2008) | 2 lines Warn if a toctree-included document doesn't contain a title. ........ r65122 | georg.brandl | 2008-07-18 23:51:28 +0200 (Fri, 18 Jul 2008) | 2 lines Don't use \samp{} for code with whitespaces, only for :samp:`code`. ........ r65123 | georg.brandl | 2008-07-19 00:49:46 +0200 (Sat, 19 Jul 2008) | 2 lines Put inheritance info always on its own line. ........
Diffstat (limited to 'sphinx/roles.py')
-rw-r--r--sphinx/roles.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/sphinx/roles.py b/sphinx/roles.py
index 618b741c..2cfca3d8 100644
--- a/sphinx/roles.py
+++ b/sphinx/roles.py
@@ -195,17 +195,17 @@ _litvar_re = re.compile('{([^}]+)}')
def emph_literal_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
text = utils.unescape(text)
- retnodes = []
pos = 0
+ retnode = nodes.literal(role=typ)
for m in _litvar_re.finditer(text):
if m.start() > pos:
txt = text[pos:m.start()]
- retnodes.append(nodes.literal(txt, txt))
- retnodes.append(nodes.emphasis('', '', nodes.literal(m.group(1), m.group(1))))
+ retnode += nodes.Text(txt, txt)
+ retnode += nodes.emphasis(m.group(1), m.group(1))
pos = m.end()
if pos < len(text):
- retnodes.append(nodes.literal(text[pos:], text[pos:]))
- return retnodes, []
+ retnode += nodes.Text(text[pos:], text[pos:])
+ return [retnode], []
specific_docroles = {