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

Improve HTML formatter output. #1500

Merged
merged 1 commit into from Aug 22, 2020
Merged

Improve HTML formatter output. #1500

merged 1 commit into from Aug 22, 2020

Conversation

Anteru
Copy link
Collaborator

@Anteru Anteru commented Jul 31, 2020

With the previous changes, we started to emit one <pre> per line for
line numbers. This breaks for instance the Sphinx-RTD-Theme, which
expects the line numbers to be formatted the same way as the normal
content. This commit makes the following changes:

  • Emit a single <pre> inside the linenos div
  • Wrap individual lines into <span> as needed
  • Update all tests
  • Don't yield empty <span> elements when no style is specified

This also makes the .html test files look correct when looked at with a
browser, as there is no extra whitespace in them which needs stripping.

With the previous changes, we started to emit one <pre> per line for
line numbers. This breaks for instance the Sphinx-RTD-Theme, which
expects the line numbers to be formatted the same way as the normal
content. This commit makes the following changes:

* Emit a single <pre> inside the linenos div
* Wrap individual lines into <span> as needed
* Update all tests
* Don't yield empty <span> elements when no style is specified

This also makes the .html test files look correct when looked at with a
browser, as there is no extra whitespace in them which needs stripping.
@Anteru Anteru added this to the 2.7 milestone Jul 31, 2020
@Anteru Anteru requested a review from birkenfeld July 31, 2020 11:09
@Anteru
Copy link
Collaborator Author

Anteru commented Jul 31, 2020

The failure is unrelated to this PR; I've opened a separate branch to investigate that (b6d1d68). This does change the formatting for linenos quite a bit, but I believe this is the right fix.

@Anteru Anteru merged commit 23604a8 into master Aug 22, 2020
@Anteru Anteru deleted the improve-linenos-handling branch February 7, 2021 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant