}
// Check if we have a LaTeX image. Remove the parent link tag
if (enType.equalsIgnoreCase("en-latex")) {
enType = "en-media";
QDomNode parent = e.parentNode();
parent.removeChild(e);
parent.parentNode().replaceChild(e, parent);
}
// If we've gotten this far, we have an en-media tag
e.setTagName(enType);
resources.add(e.attribute("guid"));
e.removeAttribute("guid");
e.removeAttribute("src");
e.removeAttribute("en-new");
e.removeAttribute("en-tag");
}
// Tags like <ul><ul><li>1</li></ul></ul> are technically valid, but Evernote
// expects that a <ul> tag only has a <li>, so we will need to change them
// to this: <ul><li><ul><li>1</li></ul></li></ul>
if (node.nodeName().equalsIgnoreCase("ul")) {
QDomNode firstChild = node.firstChild();
QDomElement childElement = firstChild.toElement();
if (childElement.nodeName().equalsIgnoreCase("ul")) {
QDomElement newElement = doc.createElement("li");
node.insertBefore(newElement, firstChild);
node.removeChild(firstChild);
newElement.appendChild(firstChild);