-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigation Screen: Use response messages returned from API for notices (
#34903) * Navigation Screen: Use response messages returned from API for notices * Remove custom alignment for notices close button * Cleanup 'menu' props usage * Temporarily duplicate 'stripHTML' dom function
- Loading branch information
Showing
7 changed files
with
52 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,6 @@ | |
.components-notice__content { | ||
margin: 0; | ||
} | ||
|
||
.components-notice__dismiss { | ||
align-self: center; | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Removes any HTML tags from the provided string. | ||
* | ||
* @todo Use `stripHTML` from `@wordpress/dom` package | ||
* after https://github.com/WordPress/gutenberg/issues/33424 | ||
* is resolved. | ||
* | ||
* @param {string} html The string containing html. | ||
* | ||
* @return {string} The text content with any html removed. | ||
*/ | ||
export function stripHTML( html ) { | ||
const document = new window.DOMParser().parseFromString( | ||
html, | ||
'text/html' | ||
); | ||
return document.body.textContent || ''; | ||
} |