'How can I render angle brackets <> in wordpress blog page

I'm new to WordPress, I just started a blog on it a few days ago and my contents contain code blocks. The problem I'm having is that I have some code that contains Generics like JpaRepository<Customer, Long> But the <> could not be rendered when I view the blog page. How can I fix this problem, please, any suggestion is appreciated.

The output on the blog post: This is what is displayed on the blog page

The blog post can be viewed here for a clear understanding of the problem. Thanks.



Solution 1:[1]

try this php native function:

https://www.php.net/manual/en/function.htmlentities.php

and here is a live example

https://www.w3schools.com/php/func_string_htmlentities.asp

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Francesco