Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for extracting @import URLs from CSS content at the extractor level. Key changes include updating the HTML asset extractor to call the new CSS extraction functions, expanding test coverage for various @import rule scenarios, and refactoring the CSS parser to differentiate between regular URLs and @import URLs.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/pkg/postprocessor/extractor/html.go | Updated to use the new ExtracFromStringCSS function for inline styles and HTML style blocks with appropriate warning log messages. |
| internal/pkg/postprocessor/extractor/css_test.go | Extended tests to cover multiple @import rule cases and validate error conditions. |
| internal/pkg/postprocessor/extractor/css.go | Refactored CSS parsing to handle @import rules and introduced helper functions with panic calls for unexpected token types. |
Comments suppressed due to low confidence (1)
internal/pkg/postprocessor/extractor/css.go:334
- The function name 'ExtracFromStringCSS' appears to contain a typo. Consider renaming it to 'ExtractFromStringCSS' for clarity and consistency.
func ExtracFromStringCSS(cssBody string, inline bool) (links []string, atImportLinks []string, err error) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#323
close: #296
This PR adds the ability to extract
@importurls at the css extractor level.Crawling and archiving these
@importurls will be implemented in the next PR.