Skip to content

🐛 FIX: Spurious newline in generated literal_block nodes #541

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cpitclaudel
Copy link
Contributor

@cpitclaudel cpitclaudel commented Apr 1, 2022

Closes #407. The details are in the original bug report, but the long story short is that Docutils already adds a newline to its <pre> blocks, so we don't need one more. I opted to fix all literal_blocks, but the most important ones are the ones in create_highlighted_code_block.

@chrisjsewell
Copy link
Member

Cheers @cpitclaudel, I will have a look probably Monday now

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #541 (45c32c8) into master (8f53a0b) will decrease coverage by 0.06%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master     #541      +/-   ##
==========================================
- Coverage   89.78%   89.72%   -0.07%     
==========================================
  Files          16       16              
  Lines        2104     2111       +7     
==========================================
+ Hits         1889     1894       +5     
- Misses        215      217       +2     
Flag Coverage Δ
pytests 89.72% <83.33%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
myst_parser/docutils_renderer.py 91.86% <83.33%> (+0.07%) ⬆️
myst_parser/mocking.py 85.43% <0.00%> (-0.79%) ⬇️

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 8f53a0b...45c32c8. Read the comment docs.

@chrisjsewell
Copy link
Member

Thanks @cpitclaudel this requires fixes for a number of the regression tests (if you didn't know you can run pytest --force-regen

My question would be though; should the behaviour be the same for docutils and sphinx? i.e.does the sphinx builder also require this new line removal?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spurious newline in generated literal_block nodes
2 participants