I don’t have a live example to post, because I haven’t come across one.
This somewhat does the job but I sort of feel uncomfortable creating a new Woo directory inside GP and removing the esc_html() function in the add to cart template (which I’m unsure is even safe), hence looking for a solution here.
add_filter( 'woocommerce_product_single_add_to_cart_text', 'svg_single_product_add_to_cart' );
function svg_single_product_add_to_cart( $button ) {
$svg_btn = '<img src="http://localhost/tractor-1/wp-content/uploads/2020/04/my-cart-btn.svg" alt="" class="wp-image-1008"/>' . $button;
return $svg_btn;
}
I have SVG Support installed and inline SVG enabled.