Generate PDF or HTML of source

Anonymouse zorael at gmail.com
Sun Mar 16 18:13:58 UTC 2025


On Sunday, 16 March 2025 at 18:02:54 UTC, Adam D. Ruppe wrote:
> On Sunday, 16 March 2025 at 17:50:44 UTC, Anonymouse wrote:
>> Lastly then, is there any CSS wizardry to be used to make it 
>> word-wrap?
>
> Yeah, I specifically disabled word wrap for code blocks because 
> I prefer horizontal scrolling them in a browser.
>
> Add this either to that same media print block, or right under 
> it (if you want it to affect in the browser too) and you should 
> get OK results:
>
>
> ```
> pre {
>  white-space: pre-wrap !important;
> }
> ```
>
> This tells it to use the pre-formatted whitespace, but allow 
> wrapping as needed, with important there to override any 
> previous commands.

The wrapping [looks a bit funky](https://i.imgur.com/aYQT5Tc.png) 
but I think I can work with this. Thanks!


More information about the Digitalmars-d-learn mailing list