-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:lang CSS selector support? #446
Comments
Ok I think I might have found the bug openhtmltopdf/openhtmltopdf-core/src/main/java/com/openhtmltopdf/css/newmatch/Condition.java Line 380 in c520a52
Suppose we have attRes.getLang(e) with return "ja" for the html element, but return empty string "" for the body element. This means getLang is not looking up the parent lang attribute. Is that expected? |
I finally found example 30 from Selectors Level 4 which suggest our behavior is wrong:
<body lang=fr>
<p>Je suis français.</p>
</body> I'll commit a fix that looks up the parent chain for a lang attribute. In the meantime, if you know the element the lang attribute is set on, you could of course use a descendant selector. html:lang(ja) body { } |
From reading the source code I found that this works with the current version |
Hi guys,
I am trying to produce a PDF, but my HTML has <style> with the :lang CSS selector.
https://www.w3schools.com/cssref/sel_lang.asp
And I have the html attribute like
https://www.w3schools.com/tags/att_global_lang.asp
However, the produced PDF is ignoring styles in body:lang(de) {}
Is there someway I can make this work? Thanks!
The text was updated successfully, but these errors were encountered: