Skip to content

Conversation

@gordonwoodhull
Copy link
Contributor

Summary

Fixes #13685

  • Fix issue where remote font URLs in brand.yml are incorrectly treated as file paths when the brand file is in a subfolder (like an extension)
  • Add isExternalPath helper to detect URLs (paths starting with a protocol like https:) and skip path joining for external font paths
  • Add ensureCssRegexMatches test assertion for verifying CSS content in supporting files

Test plan

  • Added smoke test that verifies:
    • CSS contains correct font URL (src:url("https://notofonts.github.io/...)
    • CSS does NOT contain broken path (_extensions/my-brand/https:)
  • Test passes locally

🤖 Generated with Claude Code

gordonwoodhull and others added 2 commits January 16, 2026 13:45
Add a new test assertion function that checks regex patterns against
CSS files in a document's supporting files directory. This is useful
for verifying CSS content that is generated during rendering.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a brand.yml file with remote font URLs (e.g., https://...) is
located in a subfolder (like _extensions/my-brand/), the font URL
was incorrectly joined with the path prefix, resulting in broken
paths like "_extensions/my-brand/https:/...".

Add isExternalPath helper to detect URLs and skip path joining for
external font paths.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Jan 16, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gordonwoodhull
Copy link
Contributor Author

It hallucinated ensureCssRegexMatches, which I've often wanted, so I told it to ask deepwiki how to add the assertion.

Implementation is messy and IIUC just looks for CSS files in output directory - probably should be refined before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remote fonts not recognised when using a brand extension

3 participants