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

test

parent d11231ea
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -6089,8 +6089,17 @@ std::string webedit::Api::renderTree(const blogi::webedit::EditPlugin *node, con
        }
        el = el->nextElement();
    }
    // formated=false: this fragment gets embedded into the theme's #main
    // element and re-parsed (see blogi.cpp's /render route), so pretty-
    // printing here buys nothing but readability of an intermediate string
    // nobody reads -- and it actively breaks pages whose imported CSS sets
    // white-space:pre/pre-wrap on an element (common on real scraped sites,
    // see htmlimport.cpp), since every pretty-printer newline+indent then
    // renders as literal visible whitespace instead of collapsing. On a
    // deeply-nested real-world import this blew up a single heading's
    // gap to several thousand pixels.
    libhtmlpp::HtmlString hs;
    libhtmlpp::print(wrapper, hs, true);
    libhtmlpp::print(wrapper, hs, false);
    std::string html = hs.str();
    if (!extraCss.empty()) {
        html = "<style>" + extraCss + "</style>" + html;