white-space-processing-007

White-space 'pre-line' with carriage return adjoining linefeed

WeasyPrint

This browser

Flags
ahem, may
Assertion
A carriage return before a linefeed is removed if 'white-space' is set to 'pre-line'. The linefeed may be rendered as a space or not rendered.

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' with carriage return adjoining linefeed</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 may">
 8         <meta name="assert" content="A carriage return before a linefeed is removed if 'white-space' is set to 'pre-line'.  The linefeed may be rendered as a space or not rendered.">
 9         <style type="text/css">
10             div
11             {
12                 font-family: Ahem;
13                 height: 1em;
14                 margin-bottom: 3px;
15                 width: 3em;
16             }
17             #div1
18             {
19                 white-space: pre-line;
20             }
21             #div2
22             {
23                 background-color: blue;
24             }
25         </style>
26     </head>
27     <body>
28         <p>Test passes if the black box below is the same width, or shorter, than the blue box.</p>
29         <div id="div1">XX
30 </div>
31         <div id="div2"></div>
32     </body>
33 </html>