MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / fixLinkNode

Method fixLinkNode

html/enmlformatter.cpp:551–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549
550
551void EnmlFormatter::fixLinkNode(QWebElement e) {
552 QString enTag = e.attribute("en-tag", "");
553 if (enTag.toLower() == "en-media") {
554 resources.append(e.attribute("lid").toInt());
555 e.removeAttribute("style");
556 e.removeAttribute("href");
557 e.removeAttribute("title");
558 e.removeAttribute("data-saferedirecturl");
559 removeInvalidAttributes(e);
560 e.removeAllChildren();
561 QString newXml = e.toOuterXml();
562 newXml.replace("<a", "<en-media");
563 newXml.replace("</a>", "</en-media>");
564 e.setOuterXml(newXml);
565 }
566 QString latex = e.attribute("href", "");
567 if (latex.toLower().startsWith("latex:///")) {
568 removeInvalidAttributes(e);
569 QString formula = e.attribute("title");
570 e.setAttribute("href", QString("http://latex.codecogs.com/gif.latex?%1").arg(formula));
571 //e.setOuterXml(e.toInnerXml());
572 }
573 removeInvalidAttributes(e);
574 checkAttributes(e, attrs+focus+a);
575}
576
577
578

Callers

nothing calls this directly

Calls 2

setAttributeMethod · 0.80
QStringClass · 0.50

Tested by

no test coverage detected