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

Privacy plugin causes a 404 on css #7672

Closed
4 tasks done
dr-br opened this issue Nov 5, 2024 · 7 comments · Fixed by #7673
Closed
4 tasks done

Privacy plugin causes a 404 on css #7672

dr-br opened this issue Nov 5, 2024 · 7 comments · Fixed by #7673
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@dr-br
Copy link

dr-br commented Nov 5, 2024

Context

No response

Bug description

Starting with 9.5.43 the privacy plugin causes an invalid include of a css file.
The file assets/external/fonts.googleapis.com/css.49ea35f2.css is not found, resulting in a 404.
The default Roboto font is not available, resulting in some less fancy backup font.

Version 9.5.42 and before is fine.

Related links

Reproduction

9.5.43-privacy-plugin-bug.zip

Steps to reproduce

  • Unzip the reproduction
  • mkdocs serve
  • comment/uncomment the privacy plugin results in different font styles and a 404 in the dev tools of my browser

Browser

No response

Before submitting

@squidfunk
Copy link
Owner

Thanks for reporting. Confirmed, it's a regression in 9.5.43.

@squidfunk squidfunk added the bug Issue reports a bug label Nov 5, 2024
@squidfunk
Copy link
Owner

squidfunk commented Nov 5, 2024

Tagging @nejch for visibility – there seems to be some side effect in the merged changed. The CSS file is downloaded but not copied to the site directory.

@nejch
Copy link
Contributor

nejch commented Nov 5, 2024

Strange, in my testing it was at least downloading the external files I was referencing. From the logs comparing the repro demo with .42 and .43 there's no immediate clue, but I'm guessing the new named group regex handling might affect things - taking a look as well.

@nejch
Copy link
Contributor

nejch commented Nov 5, 2024

That does seem to be the case, e.g.

value = match.group(1)

When using named groups here this should work consistently:

(.venv) z003wwtz@framework:~/tmp/9.5.43-privacy-plugin-bug$ mkdocs build
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: /home/z003wwtz/tmp/9.5.43-privacy-plugin-bug/public
INFO    -  Downloading external file: https://unpkg.com/mermaid@11/dist/mermaid.min.js
INFO    -  Downloading external file:
           https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TjASc3CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TjASc-CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TjASc2CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TjASc5CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TjASc1CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TjASc0CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TjASc6CsQ.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOkCnqEu92Fr1Mu51xFIzIFKw.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOkCnqEu92Fr1Mu51xMIzIFKw.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOkCnqEu92Fr1Mu51xEIzIFKw.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOkCnqEu92Fr1Mu51xLIzIFKw.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOkCnqEu92Fr1Mu51xGIzIFKw.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOkCnqEu92Fr1Mu51xHIzIFKw.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOkCnqEu92Fr1Mu51xIIzI.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TzBic3CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TzBic-CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TzBic2CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TzBic5CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TzBic1CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TzBic0CsTKlA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOjCnqEu92Fr1Mu51TzBic6CsQ.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmSU5fBBc4.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu72xKOzY.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu5mxKOzY.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu7mxKOzY.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu4WxKOzY.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu7WxKOzY.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu7GxKOzY.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu4mxK.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2
INFO    -  Downloading external file: https://fonts.gstatic.com/s/roboto/v32/KFOlCnqEu92Fr1MmWUlfBBc4.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlYIw.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-UlYIw.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlYIw.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlYIw.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlYIw.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ul.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0mf0h.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0mf0h.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0mf0h.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0mf0h.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0mf0h.woff2
INFO    -  Downloading external file:
           https://fonts.gstatic.com/s/robotomono/v23/L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2
INFO    -  Documentation built in 1.87 seconds
(.venv) z003wwtz@framework:~/tmp/9.5.43-privacy-plugin-bug$ tree public/assets/external/
public/assets/external/
├── fonts.googleapis.com
│   └── css.49ea35f2.css
├── fonts.gstatic.com
│   └── s
│       ├── roboto
│       │   └── v32
│       │       ├── KFOjCnqEu92Fr1Mu51TjASc0CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TjASc1CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TjASc2CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TjASc3CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TjASc5CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TjASc6CsQ.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TjASc-CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TzBic0CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TzBic1CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TzBic2CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TzBic3CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TzBic5CsTKlA.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TzBic6CsQ.woff2
│       │       ├── KFOjCnqEu92Fr1Mu51TzBic-CsTKlA.woff2
│       │       ├── KFOkCnqEu92Fr1Mu51xEIzIFKw.woff2
│       │       ├── KFOkCnqEu92Fr1Mu51xFIzIFKw.woff2
│       │       ├── KFOkCnqEu92Fr1Mu51xGIzIFKw.woff2
│       │       ├── KFOkCnqEu92Fr1Mu51xHIzIFKw.woff2
│       │       ├── KFOkCnqEu92Fr1Mu51xIIzI.woff2
│       │       ├── KFOkCnqEu92Fr1Mu51xLIzIFKw.woff2
│       │       ├── KFOkCnqEu92Fr1Mu51xMIzIFKw.woff2
│       │       ├── KFOlCnqEu92Fr1MmSU5fABc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmSU5fBBc4.woff2
│       │       ├── KFOlCnqEu92Fr1MmSU5fBxc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmSU5fCBc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmSU5fChc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmSU5fCRc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmSU5fCxc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmWUlfABc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmWUlfBBc4.woff2
│       │       ├── KFOlCnqEu92Fr1MmWUlfBxc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmWUlfCBc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmWUlfChc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmWUlfCRc4EsA.woff2
│       │       ├── KFOlCnqEu92Fr1MmWUlfCxc4EsA.woff2
│       │       ├── KFOmCnqEu92Fr1Mu4mxK.woff2
│       │       ├── KFOmCnqEu92Fr1Mu4WxKOzY.woff2
│       │       ├── KFOmCnqEu92Fr1Mu5mxKOzY.woff2
│       │       ├── KFOmCnqEu92Fr1Mu72xKOzY.woff2
│       │       ├── KFOmCnqEu92Fr1Mu7GxKOzY.woff2
│       │       ├── KFOmCnqEu92Fr1Mu7mxKOzY.woff2
│       │       └── KFOmCnqEu92Fr1Mu7WxKOzY.woff2
│       └── robotomono
│           └── v23
│               ├── L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEleUlYIw.woff2
│               ├── L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtElOUlYIw.woff2
│               ├── L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEluUlYIw.woff2
│               ├── L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEmOUlYIw.woff2
│               ├── L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEm-Ul.woff2
│               ├── L0xdDF4xlVMF-BfR8bXMIjhOsXG-q2oeuFoqFrlnAIe2Imhk1T8rbociImtEn-UlYIw.woff2
│               ├── L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSd0mf0h.woff2
│               ├── L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSh0mQ.woff2
│               ├── L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSt0mf0h.woff2
│               ├── L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSV0mf0h.woff2
│               ├── L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSx0mf0h.woff2
│               └── L0xTDF4xlVMF-BfR8bXMIhJHg45mwgGEFl0_3vrtSM1J-gEPT5Ese6hmHSZ0mf0h.woff2
└── unpkg.com
    └── mermaid@11
        └── dist
            └── mermaid.min.js

10 directories, 56 files

Just need to check that it is applied consistently when using value = match.group("url") Should have added some tests in the PR 😅

@squidfunk is this something you're already looking into or should I start a PR?

Edit: checked that the assets_expr_map regexes were only used in this replace callbacks so this should be enough. I went ahead and started #7673 since I felt responsible for the regression 😅 but feel to close it if you think there's also a more comprehensive fix 🙇

@squidfunk
Copy link
Owner

Thanks for the very fast fix @nejch! Keeping open until released.

@squidfunk squidfunk reopened this Nov 5, 2024
@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Nov 5, 2024
@squidfunk
Copy link
Owner

squidfunk commented Nov 5, 2024

Released as part of 9.5.44. Thanks again, @nejch!

@dr-br
Copy link
Author

dr-br commented Nov 6, 2024

Excellent response time!
Thanks and Dankeschön :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants