Skip to content
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

target-text(attr(href)) "inherits" text-transform: uppercase #1980

Open
pmjdebruijn opened this issue Oct 8, 2023 · 1 comment
Open

target-text(attr(href)) "inherits" text-transform: uppercase #1980

pmjdebruijn opened this issue Oct 8, 2023 · 1 comment
Labels
bug Existing features not working as expected

Comments

@pmjdebruijn
Copy link
Contributor

In this example:
target-text-attr-bug.zip

The headers are uppercased through CSS:

h1 { text-transform: uppercase; break-before: page; }

And referenced in the Table of Contents via target-text:

#contents ul li a::before { content: target-text(attr(href)); }

Note that the input text is normal mixed case:

<li><a class=h1 href="#Introduction"></a></li>

<h1 id="Introduction">Introduction</h1>

However the target-text in the ToC ends up being uppercased, as opposed being mixed case. I'm not sure whether this is intended (poor spec again) or accidental (i.e. a bug). Practically it would make sense for target-text to retrieve the original untransformed text, so text-transform can be applied independantly (or NOT).

@liZe liZe added the bug Existing features not working as expected label Jan 26, 2024
@liZe
Copy link
Member

liZe commented Jan 26, 2024

Thanks for the report.

Looks like it’s a bug in WeasyPrint, even if the specification is not 100% obvious about this (talking about "string value".

Related to #137.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants