potential fix for icon list validation when there's an embedded link … #523
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.
…within a wrapper link
There's an issue where grabbing an attribute with a source/selector combo runs the whole block through html dom parsing first. This is usually fine, but we can sometimes save "invalid" markup to the database, such as the
<a><span><a></a></span</a>
structure you'll find when you have embedded text within a wrapper link. After this is parsed the selector attribute may no longer find the content it's looking for. The structure in this case would have changed to<a><span></span</a><a></a>
. This can lead to block validation errors.so you can see the solution I came up with. I xml parse the full block content instead of letting it run through the html parser and grabbing the attribute we're looking for that way. This solution apparently doesn't work with deprecations, so it had to be in the edit/save funcitons.
The other solution to this whole thing is to change to a fully dynamic block instead of static. But that's a different conversation.
There's also a bit of change to the allowed text formats so you can't embed links while you have a wrapper link.
Also a deprecation just in case there's some difference in the xml parsed content versus the html parsed.
🎫 https://stellarwp.atlassian.net/browse/KAD-3041
...
Issue Info
Checklist
Block specific checklist (where relevant)
Are there dependent changes in another repository?