I am processing html contents with some custom elements which might be self-closing tags. Below is the example:
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><div><br/></div><en-media hash="667676uy" type="application/pdf" /><ul style="--en-todo:true;"><li style="--en-checked:false;"><div>test todoist</div></li></ul><div><br/></div><div><br/></div></en-note>
I have been trying to do it using goquery
doc, err := goquery.NewDocumentFromReader(bytes.NewReader([]byte(content)))
and after processing it, when I try to get the updated html using doc.Html()
I am getting the below output:
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><div><br/></div><en-media hash="667676uy" type="application/pdf"><ul style="--en-todo:true;"><li style="--en-checked:true;"><div>Otra prueba de Todoist</div></li></ul><div><br/></div><div><br/></div></en-media></en-note>
In my original html, I had en-media
self-closing tag but in my output html, it got nested elements.
Note: I am not updating self-closing tags.
Any help would be appreciated.