Commit f6888105 authored by jan.koester's avatar jan.koester
Browse files

test

parent 2a088f30
Loading
Loading
Loading
Loading
+2 −4
Changes for editor/htmlimport.cpp: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -732,16 +732,14 @@ bool blogi::htmlimport::convertHtmlToWidgetXml(const std::string &html,
    xmlRoot->SetAttribute("editor", "blogi");
    xmlDoc.InsertEndChild(xmlRoot);

    std::string safeHtml = sanitizeHtml(html);

    try {
        page.loadString(index, safeHtml);
        page.loadString(index, html);
        root = &index;
    } catch (...) {
        // Fallback: single CustomHtml widget with raw HTML
        tinyxml2::XMLElement *w = xmlDoc.NewElement("CustomHtml");
        tinyxml2::XMLElement *htmlContent = xmlDoc.NewElement("HtmlContent");
        htmlContent->SetText(safeHtml.c_str());
        htmlContent->SetText(html.c_str());
        w->InsertEndChild(htmlContent);
        xmlRoot->InsertEndChild(w);