Update consumesCommon.js replace Regex #8704
Open
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.
What kind of change does this PR introduce?
This PR introduces a bugfix to handle compatibility issues with Safari versions below 16, which do not support zero-width assertion regular expressions. It modifies the code to avoid using features like named capture groups or other unsupported constructs.
Did you add tests for your changes?
Yes, tests have been added to ensure the fix works correctly across all affected browser versions, including Safari versions below 16. The tests also validate that the functionality remains unchanged in other environments.
Does this PR introduce a breaking change?
No, this PR does not introduce a breaking change. It ensures backward compatibility by using alternative methods for regular expression handling.
What needs to be documented once your changes are merged?
The documentation should include:
An explanation of the changes made to support older Safari versions.
A note about the limitation of zero-width assertions in Safari below version 16.
Guidance on how users can test for compatibility in their own applications.
Checklist