0

I am rendering a text file on webpage inside <pre> tags. Right now i have encoded the input file so that < is encoded as &lt and > as &gt. But the problem comes when text file has valid html tags like <a href=......>hello</a>. In this case even the html tags are displayed as plain text not html elements. Is there a reliable way to display html elements as it is while escaping the invalid tags?

Michael Benjamin
  • 307,417
  • 93
  • 525
  • 644
Saurav Prakash
  • 1,751
  • 1
  • 10
  • 21

0 Answers0