Closes #34: exclude svg use from lrc #37
Merged
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.
Description
Fixes #34
We are adding a
_getSvgUseTargets
function toBeaconLrc
so we can detectsvg use
and avoid processing them.Type of change
Detailed scenario
Refer to wp-media/wp-rocket#6978
Technical description
Documentation
Purpose: The method gathers all parent elements of elements in the document. This is useful for operations that need to affect or be aware of the entire SVG hierarchy.
Implementation:
It first selects all elements in the document.
For each element, it traverses up the DOM tree, collecting each parent element until it reaches the .
It uses a Set to ensure that each parent element is collected only once.
Finally, it returns an array of these parent elements.
New dependencies
None
Risks
None
Mandatory Checklist
Code validation
Code style