Commit 78826a21 authored by jan.koester's avatar jan.koester
Browse files

test

parent 150d82a3
Loading
Loading
Loading
Loading
+4 −9
Changes for src/blogi.cpp: 4 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -2686,15 +2686,14 @@ RETRY_REQUEST:
                {
                    libhtmlpp::HtmlString out;

                    // First inject the editor HTML into main (before plugins run,
                    // so the template plugin can wrap it in its layers)
                    // First inject the editor HTML into main (if no specific target is provided)
                    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()){
                    if(publishTarget.empty() && root && !html.empty()){
                        try {
                            libhtmlpp::HtmlString htmlStr;
                            htmlStr << html.c_str();
@@ -2727,15 +2726,11 @@ RETRY_REQUEST:
                    }

                    // If publish preview requested, wrap through the target plugin
                    if (!publishTarget.empty() && BlogiPlg && root) {
                        libhtmlpp::HtmlString rootHtml;
                        libhtmlpp::print(*root, rootHtml);
                        std::string renderedHtml = rootHtml.str();

                    if (!publishTarget.empty() && BlogiPlg) {
                        for (const Plugin::PluginData *curplg = BlogiPlg->getFirstPlugin(); curplg; curplg = curplg->getNextPlg()) {
                            PluginApi *api = curplg->getInstace();
                            if (api && api->canPublish() && api->getName() == publishTarget) {
                                api->RenderPublished(tid, renderedHtml, publishParams, index);
                                api->RenderPublished(tid, html, publishParams, index);
                                break;
                            }
                        }