Skip to content

Fix CSS service @import hoisting for long Google Fonts URLs with semicolons#109

Merged
mreishus merged 1 commit into
mainfrom
reish20260212/fix-import-hoist
Feb 12, 2026
Merged

Fix CSS service @import hoisting for long Google Fonts URLs with semicolons#109
mreishus merged 1 commit into
mainfrom
reish20260212/fix-import-hoist

Conversation

@mreishus
Copy link
Copy Markdown
Contributor

@mreishus mreishus commented Feb 12, 2026

Fixes a CSS concat edge case where long @import URLs (for example Google Fonts URLs containing semicolons in wght values) were split at the first ; during service-side import hoisting.

The regex-based hoisting logic in service.php has been replaced with parser-style handling that finds the true end of each @import rule while respecting quoted strings, comments, and url(...) parentheses.

This preserves full import URLs and prevents broken concatenated CSS output.

Includes regression coverage in tests/test_css_service_imports.php:

  • test_service_preserves_long_google_fonts_import_with_semicolons
  • test_service_does_not_false_positive_import_substring_in_url_path
  • test_service_hoists_import_without_whitespace_after_keyword

Implemented a character level parser with Codex-5.3 and 5.2 pro.

@mreishus mreishus force-pushed the reish20260212/fix-import-hoist branch from bcb7ae1 to 2e1656c Compare February 12, 2026 17:22
@mreishus mreishus force-pushed the reish20260212/fix-import-hoist branch from 2e1656c to 557ef6d Compare February 12, 2026 19:23
@mreishus mreishus merged commit efb0b04 into main Feb 12, 2026
3 checks passed
@mreishus mreishus deleted the reish20260212/fix-import-hoist branch February 12, 2026 19:29
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.

1 participant