-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation Link UI: Try to align both files #46205
Conversation
title: props.link.label && navStripHTML( props.link.label ), | ||
title: props.link.label && stripHTML( props.link.label ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting for posterity that I believe navStripHTML
was intended as a short term work around for the fact that stripHTML
originally also collapsed leading/trailing whitespace in a given string (due to implementation details).
Whilst that was being resolved I implemented navStripHTML
which has nearly identical implementation except it does not run safeHTML
over the string. Hopefully that is just an oversight and not a huge problem.
So if there are suddenly bugs with escaping in the Link UI then we know to take a good look at this change.
Size Change: +22 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
@@ -3,6 +3,7 @@ | |||
/** | |||
* WordPress dependencies | |||
*/ | |||
import { __unstableStripHTML as stripHTML } from '@wordpress/dom'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scruffian I don't understand why but here I didn't need to use the unstable export. But in the Nav Link block I did else it would error.
Any ideas!?
@@ -1,6 +1,7 @@ | |||
/** | |||
* WordPress dependencies | |||
*/ | |||
import { __unstableStripHTML as stripHTML } from '@wordpress/dom'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using stripHTML
was undefined. Had to use the unstable version. I don't understand how because it seems to be exported as stable...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the issue with importing stripHTML
this works well.
* Navigation Link UI: Try to align both files * use correct reference to stripHTML
These two files should be as close to identical as possible. This tries to align them closer.
To test, check that both Link UI components work the same as trunk.