How can I add hyperlink in WP_Error message?

I using below code for showing error message to users in my WordPress website

if ( $wp_error ) {
    return new WP_Error( 'you_cannot_vote_on_restricted', __( 'Voting on restricted posts are not allowed.', 'anspress-question-answer' ) );
}

Now I want show error message to users with hyperlink. I use below code to do that, But this code showing just text

    if ( $wp_error ) {
return new WP_Error('no_permission', sprintf(__('strongERROR/strong: Invalid username. a href=%s title=Password Lost and FoundLost your password/a'), site_url('wp-login.php?action=lostpassword', 'login')));
}

This is my error message

How can I show error message to user with hyperlink?

Topic wp-error php plugins Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.