Commit 121971c0 authored by jan.koester's avatar jan.koester
Browse files

test

parent 57faab9b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -59,6 +59,10 @@ target_include_directories(blogi-editor PRIVATE
    ${CMAKE_SOURCE_DIR}/src
)

target_compile_definitions(blogi-editor PRIVATE
    WEBEDIT_PLUGIN_DIR="${CMAKE_INSTALL_PREFIX}/lib/blogi/plugins/webedit"
)

add_subdirectory(widgets)

install(TARGETS blogi-editor DESTINATION bin)
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ int main(int argc, char *argv[]) {
        QStringList() << "p" << "plugin-dir",
        "Directory containing webedit widget plugins.",
        "directory",
        "/usr/local/lib/blogi/plugins/webedit"
        WEBEDIT_PLUGIN_DIR
    );
    parser.addOption(pluginDirOpt);
    parser.process(app);
+3 −7
Original line number Diff line number Diff line
@@ -404,17 +404,13 @@ void blogi::Blogi::api(libhttppp::HttpRequest& curreq, const int tid){
                    json_object *params = nullptr;
                    json_object_object_get_ex(single_request, "params", &params);

                    std::string renderedHtml;
                    json_object *html_obj = nullptr;
                    if (json_object_object_get_ex(single_request, "html", &html_obj)) {
                        const char *h = json_object_get_string(html_obj);
                        if (h) renderedHtml = h;
                    }

                    bool found = false;
                    for (const Plugin::PluginData *curplg = BlogiPlg->getFirstPlugin(); curplg; curplg = curplg->getNextPlg()) {
                        PluginApi *api = curplg->getInstace();
                        if (api && api->canPublish() && api->getName() == targetPlugin) {
                            // For API-only publish: the rendered HTML is not provided here,
                            // the plugin should use an empty string or handle accordingly
                            std::string renderedHtml;
                            api->Publish(tid, renderedHtml, params, single_response);
                            found = true;
                            break;