white-space-processing-053

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

WeasyPrint

This browser

Flags
ahem
Assertion
The 'white-space' property set to 'pre-line' does remove extra spacing when two spaces are next to each other and breaks at new lines 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-line' 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-line' does remove extra spacing when two spaces are next to each other and breaks at new lines 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-line;
19             }
20             #pre2
21             {
22                 background: black;
23                 display: inline-block;
24                 height: 1em;
25                 width: 2em;
26             }
27         </style>
28     </head>
29     <body>
30         <p>Test passes if there is one box below.</p>
31         <pre id="pre1">  XX
32         XX</pre>
33         <pre id="pre2"></pre>
34     </body>
35 </html>