Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:name: option for math causes a crash #6136

Closed
tk0miya opened this issue Mar 5, 2019 · 0 comments
Closed

:name: option for math causes a crash #6136

tk0miya opened this issue Mar 5, 2019 · 0 comments

Comments

@tk0miya
Copy link
Member

tk0miya commented Mar 5, 2019

Describe the bug
:name: option for math directive causes a crash on v1.8.
I can built it successfully with v1.7.

To Reproduce
Put following mark up to your document:

.. math:: x = 1
   :name: test

and build it.

Traceback (most recent call last):
  File "/Users/tkomiya/work/sphinx/sphinx/cmd/build.py", line 304, in build_main
    app.build(args.force_all, filenames)
  File "/Users/tkomiya/work/sphinx/sphinx/application.py", line 341, in build
    self.builder.build_update()
  File "/Users/tkomiya/work/sphinx/sphinx/builders/__init__.py", line 347, in build_update
    len(to_build))
  File "/Users/tkomiya/work/sphinx/sphinx/builders/__init__.py", line 412, in build
    self.write(docnames, list(updated_docnames), method)
  File "/Users/tkomiya/work/sphinx/sphinx/builders/__init__.py", line 593, in write
    self._write_serial(sorted(docnames))
  File "/Users/tkomiya/work/sphinx/sphinx/builders/__init__.py", line 604, in _write_serial
    self.write_doc(docname, doctree)
  File "/Users/tkomiya/work/sphinx/sphinx/builders/html.py", line 731, in write_doc
    self.docwriter.write(doctree, destination)
  File "/Users/tkomiya/work/tmp/lib/python3.6/site-packages/docutils/writers/__init__.py", line 80, in write
    self.translate()
  File "/Users/tkomiya/work/sphinx/sphinx/writers/html.py", line 58, in translate
    self.document.walkabout(visitor)
  File "/Users/tkomiya/work/tmp/lib/python3.6/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/tkomiya/work/tmp/lib/python3.6/site-packages/docutils/nodes.py", line 174, in walkabout
    if child.walkabout(visitor):
  File "/Users/tkomiya/work/tmp/lib/python3.6/site-packages/docutils/nodes.py", line 166, in walkabout
    visitor.dispatch_visit(self)
  File "/Users/tkomiya/work/tmp/lib/python3.6/site-packages/docutils/nodes.py", line 1894, in dispatch_visit
    return method(node)
  File "/Users/tkomiya/work/sphinx/sphinx/writers/html.py", line 886, in visit_math_block
    visit(self, node)
  File "/Users/tkomiya/work/sphinx/sphinx/ext/mathjax.py", line 49, in html_visit_displaymath
    number = get_node_equation_number(self, node)
  File "/Users/tkomiya/work/sphinx/sphinx/util/math.py", line 28, in get_node_equation_number
    id = node['ids'][0]
IndexError: list index out of range

Expected behavior
build succeeded.

Your project
N/A

Screenshots
N/A

Environment info

  • OS: Mac
  • Python version: 3.6.5
  • Sphinx version: 1.8.4
  • Sphinx extensions: Nothing
@tk0miya tk0miya added this to the 1.8.5 milestone Mar 5, 2019
tk0miya added a commit to tk0miya/sphinx that referenced this issue Mar 5, 2019
tk0miya added a commit to tk0miya/sphinx that referenced this issue Mar 5, 2019
tk0miya added a commit that referenced this issue Mar 6, 2019
Fix #6136: ``:name:`` option for ``math`` directive causes a crash
@tk0miya tk0miya closed this as completed Mar 6, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant