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

latex: add defaults for enumerated list prefix/suffix #5490

Merged
merged 1 commit into from Oct 1, 2018

Conversation

minrk
Copy link
Contributor

@minrk minrk commented Sep 24, 2018

Subject: enumerated lists can fail to build latex if they lack the optional prefix/suffix attributes, (e.g. if they come from recommonmark parser).

Feature or Bugfix

  • Bugfix

Purpose

Adds handling for when prefix/suffix are undefined. If I understand correctly, it should not be assumed that these are always defined, since they are not part of the docutils enumerated_list object. Fixes error in make latex:

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/minrk-jupyterhub/conda/latest/lib/python3.6/site-packages/docutils/nodes.py", line 567, in __getitem__
    return self.attributes[key]
KeyError: 'prefix'

when building with enumerated lists coming from recommonmark, e.g. with index.md:

# test

1. an
2. enumerated
3. list

and conf.py:

from recommonmark.parser import CommonMarkParser
source_parsers = {'.md': CommonMarkParser}
source_suffix = ['.rst', '.md']

Build fails with the above error in 1.8.1, succeeds with 1.7.9.

Relates

these may not be defined (e.g. coming from recommonmark)
@codecov
Copy link

codecov bot commented Sep 24, 2018

Codecov Report

Merging #5490 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5490      +/-   ##
==========================================
+ Coverage   83.02%   83.02%   +<.01%     
==========================================
  Files         291      291              
  Lines       38857    38859       +2     
  Branches     5845     5845              
==========================================
+ Hits        32262    32264       +2     
  Misses       5225     5225              
  Partials     1370     1370
Impacted Files Coverage Δ
sphinx/writers/latex.py 84.13% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff8df59...af63993. Read the comment docs.

@hsiaoyi0504
Copy link

I have met the same issue.

@tk0miya tk0miya added this to the 1.8.2 milestone Oct 1, 2018
@tk0miya tk0miya merged commit c206c02 into sphinx-doc:master Oct 1, 2018
@tk0miya
Copy link
Member

tk0miya commented Oct 1, 2018

Thank you for your contribution!

tk0miya added a commit that referenced this pull request Oct 1, 2018
@tk0miya
Copy link
Member

tk0miya commented Oct 1, 2018

I cherry-picked this to 1.8 branch manually.

@hsiaoyi0504
Copy link

@tk0miya Will this present in next release ?

@tk0miya
Copy link
Member

tk0miya commented Oct 6, 2018

Yes. This will be contained in 1.8.2.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants