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: wrapped long code line has acquired color problems with current 5.x branch if it is emphasized #10615

Closed
jfbu opened this issue Jun 29, 2022 · 0 comments

Comments

@jfbu
Copy link
Contributor

jfbu commented Jun 29, 2022

Describe the bug

A wrapped long code line will have color issues it if is also emphasized. Some of input may even acquire the background color hence become invisible.

How to Reproduce

.. code-block:: python
   :linenos:
   :emphasize-lines: 1,3
   
   print("a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line has problems with colors; moreover here the closing parenthesis has same color as background hence is invisible")
   print("a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line a very long line with no problems if not emphasized")
   print("syntax highlighting is ok" + " in this short line"); A = B
   print("syntax highlighting is ok" + " in this short line"); A = B

ABC

Expected behavior

No response

Your project

N/A

Screenshots

Capture d’écran 2022-06-29 à 18 17 46

OS

Mac

Python version

3.10.4

Sphinx version

This is only for current 5.x after merge of #10577 (40841ae).

jfbu added a commit to jfbu/sphinx that referenced this issue Jun 29, 2022
This does not fix entirely sphinx-doc#10610 but it does sufficiently for it not to
require reverting sphinx-doc#10577 which tried to solve sphinx-doc#8686 conundrum.  In
extreme cases, the sphinx-doc#8686 problem meant that some contents disappearing
at page bottom, so it is probably better that to maintain sphinx-doc#10577 which
will avoid anysuch overflow of code beyond its frame, even though in
some specific cases (a colored entity such as a long string is partly on
both pages), some syntax highlighting gets lost.

There are anyhow other issues with colors for wrapped code lines, even
with no pagebreaks involved, such as sphinx-doc#10615.  This patch does not change
the situation there.
jfbu added a commit to jfbu/sphinx that referenced this issue Jun 29, 2022
This does not fix entirely sphinx-doc#10610 but it does sufficiently for it not to
require reverting sphinx-doc#10577 which tried to solve sphinx-doc#8686 conundrum.  In
extreme cases, the sphinx-doc#8686 problem meant that some contents disappeared
at page bottom, so it is probably better to maintain sphinx-doc#10577 which
will avoid any such overflow of code beyond its frame, even though in
some specific cases (a colored entity such as a long string is partly on
both pages), some syntax highlighting gets lost.

There are anyhow other issues with colors for wrapped code lines, even
with no pagebreaks involved, such as sphinx-doc#10615.  This patch does not change
the situation there.
@jfbu jfbu changed the title LaTeX: wrapped long code line has color problems if it is emphasized LaTeX: wrapped long code line has acquired color problems with current 5.x branch if it is emphasized Jun 29, 2022
@jfbu jfbu closed this as completed in d089b5c Jun 29, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2022
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