Commit 010b937b authored by jan.koester's avatar jan.koester
Browse files

test

parent d525aaa9
Loading
Loading
Loading
Loading
+14 −0
Changes for src/blogi.cpp: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2113,20 +2113,34 @@ RETRY_REQUEST:
                    index=Index;

                for(const blogi::Plugin::PluginData *curplg=BlogiPlg->getFirstPlugin(); curplg; curplg=curplg->getNextPlg()){
                    try {
                        if(mobile)
                            curplg->getInstace()->Rendering(tid,curreq,&index,RenderingType::Mobile);
                        else
                            curplg->getInstace()->Rendering(tid,curreq,&index,RenderingType::Desktop);
                    } catch(const std::exception &e) {
                        std::cerr << "/render: plugin rendering error: " << e.what() << std::endl;
                    }
                }

                {
                    libhtmlpp::HtmlString out;
                    libhtmlpp::HtmlElement *root = index.getElementbyID("main");

                    if(!root){
                        std::cerr << "/render: no element with id='main' found in theme index" << std::endl;
                    }

                    if(root && !html.empty()){
                        try {
                            libhtmlpp::HtmlString htmlStr;
                            htmlStr << html.c_str();
                            root->appendChild(htmlStr.parse());
                        } catch(libhtmlpp::HTMLException &e) {
                            std::cerr << "/render: HTML parse error: " << e.what() << std::endl;
                        } catch(const std::exception &e) {
                            std::cerr << "/render: HTML inject error: " << e.what() << std::endl;
                        }
                    }

                    // If publish preview requested, wrap through the target plugin