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
Emojis are not working w/ privacy plugin #2063
Comments
The traceback shows that the issue is related to the |
In your most recent deployment preview https://app.netlify.com/sites/privacyguides/deploys/63ff870b6a65bc0008b0fe28
which indicates that it should work. GitHub search didn't show any results but a local file search has lead me to multiple built files including:
So it does partially work 🤔 |
Very interesting. The gear icon is actually broken on https://www.privacyguides.org/en/tor/#orbot though now that I'm looking at it, which is the problem I was initially facing at squidfunk/mkdocs-material#3851 almost a year ago. It's extremely weird how the privacy plugin is sometimes breaking the build entirely, and sometimes just not replacing the external file. It's also very frustrating that it seems like this is only happening to me 🤔 |
I can't reproduce my |
It seems to be related to how lxml handles Unicode. It's a mess. |
If I remove |
Our CSP blocks loading images from external sources. This is a privacy decision, obviously we could just fix it by adding cdnjs.cloudflare.com to the CSP, but the privacy plugin is supposed to convert the image |
The plot thickens, removing any of these three lines from the mkdocs config also fixes the issue with the gear emoji on the tor page, which makes no sense 🤔 |
It feels almost random... squidfunk last time said that changing the order of the plugins in the mkdocs.yml file doesn't affect the order of execution, because the privacy plugin uses the MkDocs event priorities. However, he also said that it works concurrently, so maybe there is an edge-case where instead of the replaced private resource it gets the results from another Markdown parser without the replaced path 🤔. In the Netlifly log the resource was downloaded, but the path wasn't replaced. Those emojis are used on multiple pages, so maybe another page triggered the download and got a correctly swapped path, and the issue lies primarily in the tor.md file 🤷 |
Looking through.. that gear is used on other pages and loads normally at https://www.privacyguides.org/en/mobile-browsers/#recommended-configuration_1 for example. It's very inconsistent though. Actually the problem doesn't seem to be limited to just emojis at all, the privacy plugin just generally isn't replacing all assets. Half the pages (including the Tor page) have externally-linked contributor avatars for example: ...while the other half work fine: But it isn't even consistent on a page-by-page basis. The mobile browsers page has correctly embedded emojis but broken contributor avatars 🤔 |
That could be a bug in the plugin, but it would be surprising, as we deliberately reconcile all downloads before applying replacements. Specifically:
There could still be race conditions. I tried to think of all cases – I recommend to read the comments in the plugin. If a reproduction could be provided, that would be amazing. Happy to fix it and improve the plugin. |
I was making this way too complicated in my head. I think this is just a matter of it not handling a lot of external resources on a page correctly. Add enough gears and eventually it breaks: @squidfunk I can easily reproduce this on a two-file install: Archive.zip |
Ok, brute-force debugging with a lot of external resources on the page is much better 👍 |
Since this does seem to be an upstream plugin issue I'll close this and track squidfunk/mkdocs-material#5127 instead :) |
Tracking two separate issues I'm having with the mkdocs-material privacy plugin:
Adding emojis to a page (like
:gear:
on tor.md) results in a broken image because the privacy plugin is not replacing the asset correctly:The broken image is due to CSP not allowing external assets, not because the external asset doesn't exist and the plugin couldn't grab it.
Adding a flag emoji to a page, for exampleFixed upstream.file-sharing.md
here, results in a build failure.The text was updated successfully, but these errors were encountered: