WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

::marker don't respect trailing spaces

Open jjsarton opened this issue 2 years ago • 2 comments

<style>
.markers::marker { content: '- '; }
.marker::marker { content: '-'; }
.pre { white-space: pre; }

</style>
<ul>
	<li class="markers">Item content: '- '; </li>
	<li class="markers pre">Item content: '- '; white-space:pre;</li>
	<li class="marker">Item content: '-'; </li>
</ul>

Firefox / Chromium rendering:

   - Item content: '- ';
   - Item content: '- '; white-space:pre;
    -Item content: '-'; 

Weasyprint rendering

   -Item content: '- ';
  - Item content: '- '; white-space:pre;
   -Item content: '-'; 

jjsarton avatar May 27 '23 06:05 jjsarton

I just wanted to make an issue, but I guess it would be a duplicate:

<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>List</title>
        <style>
            ol.custom {
                counter-reset: olcnt;
                > li {
                    counter-increment: olcnt;
                  
                    &::marker {
                        content: counter(olcnt) '. ';
                    }
                }
            }
            ul.custom {
                > li::marker {
                    content: '. ';
                }
            }
        </style>
    </head>

    <body>
        <ul>
            <li>Hello</li>
            <li>World</li>
        </ul>
        <ol>
            <li>Hello</li>
            <li>World</li>
        </ol>
        
        <ul class="custom">
            <li>Hello</li>
            <li>World</li>
        </ul>
        <ol class="custom">
            <li>Hello</li>
            <li>World</li>
        </ol>
    </body>
</html>

Browser: Image

Weasyprint: Image

mbndr avatar Dec 11 '25 12:12 mbndr

I just wanted to make an issue, but I guess it would be a duplicate:

Yes, it is.

liZe avatar Dec 11 '25 13:12 liZe