-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
When the rel attribute of the link element has multiple values (including stylesheet), it will be ignored. #635
Comments
I have applied this to my library and the above approach correctly retrieves link elements. Here is my commit and an example: |
Fascinating, I'm surprised this hasn't come up as a bug before! Thanks for the links, I'll get a fix in this evening! Also, nice package with |
Your level of activity is impressive and very willing to communicate with someone like you. I had never even heard of the I investigated the issue further: I am using vitepress to write my documentation, which uses preload to load CSS styles. In the process, I found that the above solution is not perfect, as the Therefore, when querying link elements, it may be necessary to use a selector statement like this: Perhaps you have a better solution.🤔 |
Thank you ❤️ Web is full of surprises, thanks for the additional research! I'll play around with some options and make a PR this weekend |
Having some issues with npm, but once resolved the fix for this will be in version |
Hi @MatthewHerbst , this is really happy news, please accept my best wishes. 白头偕老,永结同心。💕 Greetings from China. |
The MDN documentation states that the rel attribute can have multiple values separated by whitespace.
However, current implementations only match link elements with rel="stylesheet".
https://github.com/gregnb/react-to-print/blob/977b034c10932f91eca13468c2042dc577fcf73d/src/index.tsx#L437
In my use case, I have a link element like this, which causes the associated styles to not work in print preview.
I have found a solution which is to use the ~= CSS selector.
The text was updated successfully, but these errors were encountered: