Image tag not closing with HTMLAgilityPack

前端 未结 4 1945
感情败类
感情败类 2020-12-01 16:59

Using the HTMLAgilityPack to write out a new image node, it seems to remove the closing tag of an image, e.g. should be but when you check outer html, has .



        
4条回答
  •  温柔的废话
    2020-12-01 17:41

    There is an option to turn on XML output that makes this issue go away.

    var htmlDoc = new HtmlDocument();
    htmlDoc.OptionOutputAsXml = true;
    htmlDoc.LoadHtml(rawHtml);
    

提交回复
热议问题