white-space-processing-052

White-space 'pre-wrap' on a 'pre' element

WeasyPrint

This browser

Flags
ahem
Assertion
The 'white-space' property set to 'pre-wrap' does not remove extra spacing when two spaces are next to each other and introduces line breaking opportunities when set on a 'pre' element.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3     <head>
 4         <title>CSS Test: White-space 'pre-wrap' on a 'pre' element</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#white-space-model">
 7         <meta name="flags" content="ahem">
 8         <meta name="assert" content="The 'white-space' property set to 'pre-wrap' does not remove extra spacing when two spaces are next to each other and introduces line breaking opportunities when set on a 'pre' element.">
 9         <style type="text/css">
10             pre
11             {
12                 font: 16px/1em Ahem;
13                 margin: 0;
14                 padding: 0;
15             }
16             #pre1
17             {
18                 white-space: pre-wrap;
19                 width: 5em;
20             }
21             #pre2
22             {
23                 background: black;
24                 display: inline-block;
25                 height: 1em;
26                 width: 2em;
27             }
28         </style>
29     </head>
30     <body>
31         <p>Test passes if there is one box below.</p>
32         <pre id="pre1">XX  XX</pre>
33         <pre id="pre2"></pre>
34     </body>
35 </html>