Updated task progress header title (#37546)
* Updated task progress header title ## Issue Special characters in site titles would not render as readable text in the mentioned title. ## Summary Updated task progress header title to support special characters using the dangerouslySetInnerHTML function was a ready solution used throughout the application, so it makes sense to apply it here as well. * Import sanitizeHTML * Add changelog * Tweak changelog --------- Co-authored-by: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
This commit is contained in:
parent
2f75edf505
commit
252c2593b2
|
@ -7,6 +7,11 @@ import { useSelect } from '@wordpress/data';
|
|||
import { getVisibleTasks, ONBOARDING_STORE_NAME } from '@woocommerce/data';
|
||||
import { getSetting } from '@woocommerce/settings';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import sanitizeHTML from '../../lib/sanitize-html';
|
||||
|
||||
export type DefaultProgressTitleProps = {
|
||||
taskListId: string;
|
||||
};
|
||||
|
@ -64,6 +69,9 @@ export const DefaultProgressTitle: React.FC< DefaultProgressTitleProps > = ( {
|
|||
}
|
||||
|
||||
return (
|
||||
<h1 className="woocommerce-task-progress-header__title">{ title }</h1>
|
||||
<h1
|
||||
className="woocommerce-task-progress-header__title"
|
||||
dangerouslySetInnerHTML={ sanitizeHTML( title ) }
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix special characters not rendered in admin titles
|
Loading…
Reference in New Issue