Image tag not closing with HTMLAgilityPack

前端 未结 4 1965
感情败类
感情败类 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:36

    Telling it to output XML as Micky suggests works, but if you have other reasons not to want XML, try this:

    doc.OptionWriteEmptyNodes = true;
    

提交回复
热议问题