mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
sphinx.ext.math: Update the label of permalink
This commit is contained in:
parent
2c5a9f3975
commit
0e829c845e
@ -255,7 +255,7 @@ def html_visit_displaymath(self, node):
|
||||
self.body.append('<p>')
|
||||
if node['number']:
|
||||
self.body.append('<span class="eqno">(%s)' % node['number'])
|
||||
self.add_permalink_ref(node, _('Permalink to this code'))
|
||||
self.add_permalink_ref(node, _('Permalink to this equation'))
|
||||
self.body.append('</span>')
|
||||
if fname is None:
|
||||
# something failed -- use text-only as a bad substitute
|
||||
|
@ -36,7 +36,7 @@ def html_visit_displaymath(self, node):
|
||||
# necessary to e.g. set the id property correctly
|
||||
if node['number']:
|
||||
self.body.append('<span class="eqno">(%s)' % node['number'])
|
||||
self.add_permalink_ref(node, _('Permalink to this code'))
|
||||
self.add_permalink_ref(node, _('Permalink to this equation'))
|
||||
self.body.append('</span>')
|
||||
self.body.append(self.starttag(node, 'div', CLASS='math'))
|
||||
else:
|
||||
|
@ -37,7 +37,7 @@ def html_visit_displaymath(self, node):
|
||||
# necessary to e.g. set the id property correctly
|
||||
if node['number']:
|
||||
self.body.append('<span class="eqno">(%s)' % node['number'])
|
||||
self.add_permalink_ref(node, _('Permalink to this code'))
|
||||
self.add_permalink_ref(node, _('Permalink to this equation'))
|
||||
self.body.append('</span>')
|
||||
self.body.append(self.builder.config.mathjax_display[0])
|
||||
parts = [prt for prt in node['latex'].split('\n\n') if prt.strip()]
|
||||
|
@ -23,7 +23,7 @@ def test_jsmath(app, status, warning):
|
||||
assert '<div class="math">\na^2 + b^2 = c^2</div>' in content
|
||||
assert '<div class="math">\n\\begin{split}a + 1 < b\\end{split}</div>' in content
|
||||
assert (u'<span class="eqno">(1)<a class="headerlink" href="#equation-foo" '
|
||||
u'title="Permalink to this code">\xb6</a></span>'
|
||||
u'title="Permalink to this equation">\xb6</a></span>'
|
||||
u'<div class="math" id="equation-foo">\ne^{i\\pi} = 1</div>' in content)
|
||||
assert ('<span class="eqno">(2)</span><div class="math">\n'
|
||||
'e^{ix} = \\cos x + i\\sin x</div>' in content)
|
||||
|
Loading…
Reference in New Issue
Block a user