mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Fixes #1915: Do not generate smart quotes in doc field type annotations.
This commit is contained in:
@@ -32,6 +32,7 @@ Bugs fixed
|
|||||||
* Work around the lack of the HTMLParserError exception in Python 3.5.
|
* Work around the lack of the HTMLParserError exception in Python 3.5.
|
||||||
* #1949: Use ``safe_getattr`` in the coverage builder to avoid aborting with
|
* #1949: Use ``safe_getattr`` in the coverage builder to avoid aborting with
|
||||||
descriptors that have custom behavior.
|
descriptors that have custom behavior.
|
||||||
|
* #1915: Do not generate smart quotes in doc field type annotations.
|
||||||
|
|
||||||
|
|
||||||
Release 1.3.1 (released Mar 17, 2015)
|
Release 1.3.1 (released Mar 17, 2015)
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ class Field(object):
|
|||||||
self.rolename = rolename
|
self.rolename = rolename
|
||||||
self.bodyrolename = bodyrolename
|
self.bodyrolename = bodyrolename
|
||||||
|
|
||||||
def make_xref(self, rolename, domain, target, innernode=nodes.emphasis,
|
def make_xref(self, rolename, domain, target,
|
||||||
contnode=None):
|
innernode=addnodes.literal_emphasis, contnode=None):
|
||||||
if not rolename:
|
if not rolename:
|
||||||
return contnode or innernode(target, target)
|
return contnode or innernode(target, target)
|
||||||
refnode = addnodes.pending_xref('', refdomain=domain, refexplicit=False,
|
refnode = addnodes.pending_xref('', refdomain=domain, refexplicit=False,
|
||||||
@@ -159,7 +159,8 @@ class TypedField(GroupedField):
|
|||||||
fieldtype = types.pop(fieldarg)
|
fieldtype = types.pop(fieldarg)
|
||||||
if len(fieldtype) == 1 and isinstance(fieldtype[0], nodes.Text):
|
if len(fieldtype) == 1 and isinstance(fieldtype[0], nodes.Text):
|
||||||
typename = u''.join(n.astext() for n in fieldtype)
|
typename = u''.join(n.astext() for n in fieldtype)
|
||||||
par += self.make_xref(self.typerolename, domain, typename)
|
par += self.make_xref(self.typerolename, domain, typename,
|
||||||
|
addnodes.literal_emphasis)
|
||||||
else:
|
else:
|
||||||
par += fieldtype
|
par += fieldtype
|
||||||
par += nodes.Text(')')
|
par += nodes.Text(')')
|
||||||
|
|||||||
Reference in New Issue
Block a user