mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix annotations for writers
This commit is contained in:
parent
d8b8ef559e
commit
488d3263f3
@ -285,7 +285,7 @@ class HTMLTranslator(BaseTranslator):
|
|||||||
|
|
||||||
# overwritten
|
# overwritten
|
||||||
def visit_admonition(self, node, name=''):
|
def visit_admonition(self, node, name=''):
|
||||||
# type: (nodes.admonition, unicode) -> None
|
# type: (nodes.Element, unicode) -> None
|
||||||
self.body.append(self.starttag(
|
self.body.append(self.starttag(
|
||||||
node, 'div', CLASS=('admonition ' + name)))
|
node, 'div', CLASS=('admonition ' + name)))
|
||||||
if name:
|
if name:
|
||||||
@ -372,7 +372,7 @@ class HTMLTranslator(BaseTranslator):
|
|||||||
# overwritten
|
# overwritten
|
||||||
def visit_bullet_list(self, node):
|
def visit_bullet_list(self, node):
|
||||||
# type: (nodes.bullet_list) -> None
|
# type: (nodes.bullet_list) -> None
|
||||||
if len(node) == 1 and node[0].tagname == 'toctree':
|
if len(node) == 1 and isinstance(node[0], addnodes.toctree):
|
||||||
# avoid emitting empty <ul></ul>
|
# avoid emitting empty <ul></ul>
|
||||||
raise nodes.SkipNode
|
raise nodes.SkipNode
|
||||||
self.generate_targets_for_listing(node)
|
self.generate_targets_for_listing(node)
|
||||||
|
@ -221,7 +221,7 @@ class HTML5Translator(BaseTranslator):
|
|||||||
if self.settings.cloak_email_addresses and \
|
if self.settings.cloak_email_addresses and \
|
||||||
atts['href'].startswith('mailto:'):
|
atts['href'].startswith('mailto:'):
|
||||||
atts['href'] = self.cloak_mailto(atts['href'])
|
atts['href'] = self.cloak_mailto(atts['href'])
|
||||||
self.in_mailto = 1
|
self.in_mailto = True
|
||||||
else:
|
else:
|
||||||
assert 'refid' in node, \
|
assert 'refid' in node, \
|
||||||
'References must have "refuri" or "refid" attribute.'
|
'References must have "refuri" or "refid" attribute.'
|
||||||
@ -254,7 +254,7 @@ class HTML5Translator(BaseTranslator):
|
|||||||
|
|
||||||
# overwritten
|
# overwritten
|
||||||
def visit_admonition(self, node, name=''):
|
def visit_admonition(self, node, name=''):
|
||||||
# type: (nodes.admonition, unicode) -> None
|
# type: (nodes.Element, unicode) -> None
|
||||||
self.body.append(self.starttag(
|
self.body.append(self.starttag(
|
||||||
node, 'div', CLASS=('admonition ' + name)))
|
node, 'div', CLASS=('admonition ' + name)))
|
||||||
if name:
|
if name:
|
||||||
@ -325,7 +325,7 @@ class HTML5Translator(BaseTranslator):
|
|||||||
# overwritten
|
# overwritten
|
||||||
def visit_bullet_list(self, node):
|
def visit_bullet_list(self, node):
|
||||||
# type: (nodes.bullet_list) -> None
|
# type: (nodes.bullet_list) -> None
|
||||||
if len(node) == 1 and node[0].tagname == 'toctree':
|
if len(node) == 1 and isinstance(node[0], addnodes.toctree):
|
||||||
# avoid emitting empty <ul></ul>
|
# avoid emitting empty <ul></ul>
|
||||||
raise nodes.SkipNode
|
raise nodes.SkipNode
|
||||||
super(HTML5Translator, self).visit_bullet_list(node)
|
super(HTML5Translator, self).visit_bullet_list(node)
|
||||||
|
Loading…
Reference in New Issue
Block a user