MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

πŸ› FIX: Spurious newline in generated literal_block nodes

Open cpitclaudel opened this issue 3 years ago β€’ 3 comments

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.

cpitclaudel avatar Apr 01 '22 05:04 cpitclaudel

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

chrisjsewell avatar Apr 01 '22 19:04 chrisjsewell

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%) :arrow_down:

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%) :arrow_up:
myst_parser/mocking.py 85.43% <0.00%> (-0.79%) :arrow_down:

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.

codecov[bot] avatar Apr 13 '22 21:04 codecov[bot]

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?

chrisjsewell avatar Apr 13 '22 21:04 chrisjsewell