Skip to content

Commit

Permalink
Merge pull request #10048 from pradyunsg/change-heading-anchor-tooltip
Browse files Browse the repository at this point in the history
Change "headline" to "heading"
  • Loading branch information
tk0miya committed Jan 2, 2022
2 parents b21b90d + bc63562 commit 3cb680a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sphinx/themes/basic/static/doctools.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ var Documentation = {
$('div[id] > :header:first').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this headline')).
attr('title', _('Permalink to this heading')).
appendTo(this);
});
$('dt[id]').each(function() {
Expand Down
4 changes: 2 additions & 2 deletions sphinx/writers/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,12 @@ def depart_title(self, node: Element) -> None:
node.parent.hasattr('ids') and node.parent['ids']):
# add permalink anchor
if close_tag.startswith('</h'):
self.add_permalink_ref(node.parent, _('Permalink to this headline'))
self.add_permalink_ref(node.parent, _('Permalink to this heading'))
elif close_tag.startswith('</a></h'):
self.body.append('</a><a class="headerlink" href="#%s" ' %
node.parent['ids'][0] +
'title="%s">%s' % (
_('Permalink to this headline'),
_('Permalink to this heading'),
self.config.html_permalinks_icon))
elif isinstance(node.parent, nodes.table):
self.body.append('</span>')
Expand Down
4 changes: 2 additions & 2 deletions sphinx/writers/html5.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,12 @@ def depart_title(self, node: Element) -> None:
node.parent.hasattr('ids') and node.parent['ids']):
# add permalink anchor
if close_tag.startswith('</h'):
self.add_permalink_ref(node.parent, _('Permalink to this headline'))
self.add_permalink_ref(node.parent, _('Permalink to this heading'))
elif close_tag.startswith('</a></h'):
self.body.append('</a><a class="headerlink" href="#%s" ' %
node.parent['ids'][0] +
'title="%s">%s' % (
_('Permalink to this headline'),
_('Permalink to this heading'),
self.config.html_permalinks_icon))
elif isinstance(node.parent, nodes.table):
self.body.append('</span>')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ def test_html_permalink_icon(app):

assert ('<h1>The basic Sphinx documentation for testing<a class="headerlink" '
'href="#the-basic-sphinx-documentation-for-testing" '
'title="Permalink to this headline"><span>[PERMALINK]</span></a></h1>' in content)
'title="Permalink to this heading"><span>[PERMALINK]</span></a></h1>' in content)


@pytest.mark.sphinx('html', testroot='html_signaturereturn_icon')
Expand Down

0 comments on commit 3cb680a

Please sign in to comment.