Forum Bugs

:first-letter selector removing <em> tag

luiz_borges
With the following test HTML:
<p class="Format"><em>Test of Some Text in Italic,</em> This is Normal Text.</p>

And the following CSS:
p.Format { text-transform:lowercase; }
p.Format:first-letter { text-transform:uppercase; }

The expected result would be:
Test of some text in italic, this is normal text.

But instead, I'm getting this:
Test of some text in italic, this is normal text.

The first letter ('T' in this case) is losing the emphasis tag for some reason...
mikeday
Right, it seems to work when the italics are applied directly to the <p> element, or if the ::first-letter pseudo-element is moved to the <em> element. But in this particular case Prince is behaving differently to browsers, and I suspect the CSS specification. We will investigate. :)
luiz_borges
Yes, I did noticed that browsers did work as intented.

I hope you find a way for it to work, as I can see no workaround to make it displays the formatting the way I want.
mikeday
Prince 8.1 is now available with a fix for this issue, and also support for the ::first-line pseudo-element.
luiz_borges
Now text-transform is not working with ::first-letter (it worked before).

p.Format:first-letter { text-transform:lowercase; color: red; }

Only the color changes in the code above.
mikeday
It looks like this is a bug introduced when we fixed the other ::first-letter bug and added support for ::first-line. We will have to fix it and make a maintenance release; thanks for letting us know! :)
mikeday
Today we have released Prince 8.1 rev 3, which includes a fix for this bug, so text-transform should work properly on ::first-letter again.