Loading plugins/staticpage/static.cpp +7 −3 Changes for plugins/staticpage/static.cpp: 7 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -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); } Loading Loading
plugins/staticpage/static.cpp +7 −3 Changes for plugins/staticpage/static.cpp: 7 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -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); } Loading