MaxMelcher / AzureDevOps.WikiPDFExport

Export Azure DevOps Wiki to PDF
MIT License
191 stars 65 forks source link

Truncated Code Sections #96

Closed Diom closed 2 years ago

Diom commented 2 years ago

Code sections are getting truncated, both with and without highlight for color:

image

Is it necessary to manually wrap them? Or can CSS help?

Diom commented 2 years ago

Yes CSS helps:

pre{
    font-size: small;
    page-break-inside: avoid;
    overflow-x: auto !important;
    white-space: pre-wrap !important;       /* Since CSS 2.1 */
    white-space: -moz-pre-wrap !important;  /* Mozilla, since 1999 */
    white-space: -pre-wrap !important;      /* Opera 4-6 */
    white-space: -o-pre-wrap !important;    /* Opera 7 */
    word-wrap: break-word !important;       /* Internet Explorer 5.5+ */
}

code{
    font-size: small;
    page-break-inside: avoid;
    white-space: normal !important;
}