Skip to content

Update kolibri-zip with support for css import statements, fix browser compatibility#14085

Merged
rtibbles merged 2 commits intolearningequality:release-v0.19.xfrom
rtibbles:css_of_no_import
Feb 10, 2026
Merged

Update kolibri-zip with support for css import statements, fix browser compatibility#14085
rtibbles merged 2 commits intolearningequality:release-v0.19.xfrom
rtibbles:css_of_no_import

Conversation

@rtibbles
Copy link
Member

@rtibbles rtibbles commented Jan 20, 2026

Summary

  • Adds test coverage and capability for handling CSS import statements and replacing their URLs with blob url references
  • Fixes browser incompatibility issue caused by usage of regex look behind

References

No open issue, noticed in the process of working on #12805 and browser compatibility testing

Reviewer guidance

I think the test coverage here is sufficient to give assurance, but testing H5Ps on older desktop Safari versions should show the improvement. See the regex look behind caniuse for candidates: https://caniuse.com/js-regexp-lookbehind
Firefox 77 or Safari 16.3 should be old enough!

rtibbles and others added 2 commits January 17, 2026 14:51
The cssPathRegex was using a lookbehind assertion which is not supported
in Safari <16.4 and older JavaScript engines. This change adds a
feature detection at module load and provides both modern and legacy
implementations that produce identical results.

The legacy regex uses alternation to handle quoted and unquoted URLs
separately, with proper escape sequence handling for quoted strings.
Both implementations are exported via _internal for testing, and tests
now run against both versions using jest.each.
Copy link
Member

@LianaHarris360 LianaHarris360 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic looks correct and passing tests cover the behavior, approving!

@rtibbles rtibbles merged commit f59856d into learningequality:release-v0.19.x Feb 10, 2026
59 checks passed
@rtibbles rtibbles deleted the css_of_no_import branch February 10, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants