title: How to read HTML template, replace text and convert back to HTML
body: <p>I am currently loading a html file from a filepath and reading it as text. I then replace certain characters in the file itself and I want to convert it back to html. </p>
  
  <p>This is how I do it currently:</p>
  
  <pre><code>HtmlDocument document = new HtmlDocument();
  document.Load(@message.Location);
  content = document.DocumentNode.OuterHtml;
  
  //Code to replace text
  
  var eContent = HttpUtility.HtmlEncode(content);
  </code></pre>
  
  <p>When I debug and check what eContent holds, I can see newline characters like "\r\n". If I copy and paste the text into a .html file, only the text appears, not a proper html page.</p>
  
  <p>I'm using Html AgilityPack already and am unsure of what else I need to do.</p>
  
  <p>EDIT:</p>
  
  <p>I have also tried </p>
  
  <pre><code>var result = new HtmlString(content);
  </code></pre>