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:
Dano 2023-04-12 23:42:22 -04:00 committed by GitHub
parent 2f75edf505
commit 252c2593b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -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 ) }
/>
);
};

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix special characters not rendered in admin titles