WeasyPrint
WeasyPrint copied to clipboard
white-space: pre-wrap wraps spans prematurely
Hi there! Spans seem to be wrapped to a new line in their entirety when white-space: pre-wrap is set.
Repro code:
<style>
.highlight {
background-color: #ffff00;
}
code {
white-space: pre-wrap;
display: block;
max-width: 250px;
}
</style>
<code>
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
</code>
<hr>
<code>
00 00 00 00 00 00 00 00 00 00 <span class="highlight">00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span> 00 00 00 00 00
</code>
WeasyPrint output:
Expected output:
Not quite sure why this is happening or how to stop it from happening.
Thanks for the report. That’s probably related to #2025.