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

Output is not printing-friendly #206

Closed
sabi0 opened this issue Apr 12, 2019 · 2 comments
Closed

Output is not printing-friendly #206

sabi0 opened this issue Apr 12, 2019 · 2 comments

Comments

@sabi0
Copy link

sabi0 commented Apr 12, 2019

Step 0: Describe your environment

  • OS: Win 7 + Firefox 66
  • diff2html version: whatever is used by the online demo at diff2html.xyz

Step 1: Describe the problem:

Printing diff2html output does not preserve color highlighting and clips long lines.

I wanted to print some diff's to review them "pen and paper" style while being offline. But this turned out to be infeasible with diff2html output.

Steps to reproduce:

  1. Open a demo page https://diff2html.xyz/demo.html?diff=https://github.com/rtfpessoa/diff2html/pull/106
  2. Print it (or open a Print preview)

Observed Results:

  • Background coloring is lost (even though it is enabled for printing in Page setup in the browser). The only parts left of it are tiny stripes on the left.
  • Long lines are clipped on the right side of the rendered output
  • Two columns with line numbers are merged into one

image

Expected Results:

  • Printed version should have the same coloring and layout as the "live" one
  • Long lines should be wrapped to avoid clipping
  • Printing style could use the whole page width to waste less paper

image

@rtfpessoa
Copy link
Owner

Hi @sabi0,
I actually never thought of that use case.

  1. Since highlight is only done in the browser using DOM manipulation by highlight.js is normal that it does not get printed.
  2. Wrapping is mostly a CSS problem, due to the way the HTML and CSS are done it is hard to achieve it with the current setup.

If you feel like working on improving any of these things I would gladly accept the PR.

@rtfpessoa
Copy link
Owner

Since 2. is related to #99 and 1. is kind of an out of scope case closing it for now.
If someone feels like thinking about this let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants