title: Strip parsed html text from html comments using AngleSharp
body: <p>I use the code below to strip specific html tags from parsed html using <code>AngleSharp</code> (as it is recommendable over using regular expressions to do such jobs (<code>AngleSharp</code> is currently maintained, <code>HtmlAgilityPack</code> not, hence I have been moving to the latter).</p>
  
  <p>It works great - but now I want to remove html comments as well. Meaning whatever is found between <code>&lt;!--</code> and <code>--&gt;</code> tags.</p>
  
  <p>How would this be achieved using <code>AngleSharp</code> ? Using QuerySelector does not seem suiting here.</p>
  
  <pre><code>private string ExtractContentFromHtml(string input)
  {
      List&lt;string&gt; tagsToRemove = new List&lt;string&gt;
      {
          "script",
          "style",
          "img"
      };
  
      var config = Configuration.Default.WithJavaScript();
  
      HtmlParser hp = new HtmlParser(config);
      List&lt;IElement&gt; tags = new List&lt;IElement&gt;();
      List&lt;string&gt; nodeTypes = new List&lt;string&gt;();
      var hpResult = hp.Parse(input);
  
      try
      {
          foreach (var tagToRemove in tagsToRemove)
              tags.AddRange(hpResult.QuerySelectorAll(tagToRemove));
  
          foreach (var tag in tags)
              tag.Remove();
      }
      catch (Exception ex)
      {
          _errors.Add(string.Format("Error in cleaning html. {0}", ex.Message));
      }
  
      var content = hpResult.QuerySelector("body");
  
      return (content).InnerHtml;
  }
  </code></pre>