Commit 9a6cdc38 authored by jan.koester's avatar jan.koester
Browse files

te4s

parent 938aaafb
Loading
Loading
Loading
Loading
+7 −3
Changes for plugins/staticpage/static.cpp: 7 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -533,9 +533,13 @@ bool blogi::StaticPage::Controller(const int tid,libhttppp::HttpRequest &req,lib
            page->getElementbyID("main")->insertChild(condat.parse());
        } catch(libhtmlpp::HTMLException &e) {
            std::cerr << "staticpage: HTML error in '" << surl << "': " << e.what() << std::endl;
            libhtmlpp::HtmlString fallback;
            fallback << "<div id=\"content\" class=\"staticpage\"><p>HTML Rendering Error</p></div>";
            page->getElementbyID("main")->insertChild(fallback.parse());
            // Retry with content as plain text so the page still displays something
            libhtmlpp::HtmlElement content("div");
            content.setAttribute("id","content");
            content.setAttribute("class","staticpage");
            if(res[0][1])
                content.appendChild(libhtmlpp::TextElement(res[0][1]));
            page->getElementbyID("main")->appendChild(content);
        }