How to escape < and > inside pre tags with HTML? Spread the love To escape < and > inside pre tags with HTML, we use HTML entities. For instance, we write <pre> PrimeCalc calc = new PrimeCalc(); Func<int, int> del = calc.GetNextPrime; </pre> to replace < with < and replace > with >. Related