Skip to content

x/website: better HTML printing, don't page break inside code blocks #33933

@greywolve

Description

@greywolve

I was trying to print out Effective Go and I noticed code blocks get split across pages.

This is easily fixed by amending the CSS a bit:

@media print {
  pre {
    background: #fff;
    border: 0.0625rem solid #bbb;
    white-space: pre-wrap;
    page-break-inside: avoid; // added this
  }
}

Before:
Screenshot from 2019-08-29 14-03-33

After:
Screenshot from 2019-08-29 14-05-26

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions