diff --git a/routes/css.cpp b/routes/css.cpp index 21d8423..d6939e9 100644 --- a/routes/css.cpp +++ b/routes/css.cpp @@ -22,9 +22,11 @@ static const constexpr char css[] = R"EOF( margin: 0; padding: 0; } -p, details { +/* .quote-inline and display: block: workaround for vt.social/@lina?max_id=111463476293964258 */ +p, details, .quote-inline { margin-top: 1em; margin-bottom: 1em; + display: block; } ul, ol { margin: revert; diff --git a/servehelper.cpp b/servehelper.cpp index ffe7104..1c55e37 100644 --- a/servehelper.cpp +++ b/servehelper.cpp @@ -387,7 +387,14 @@ static Element serialize_post(const httplib::Request& req, const std::string& se : "Created: "s + full_time(post.created_at) + "\nEdited: " + full_time(post.edited_at); const char* time_badge = post.edited_at < 0 ? "" : " (edited)"; - Element contents("div", {{"class", "post-contents"}}, {preprocess_html(req, server, post.emojis, post.content)}); + blankie::html::HTMLString preprocessed_html = preprocess_html(req, server, post.emojis, post.content); + // Workaround for https://vt.social/@a1ba@suya.place/110552480243348878#m + if (preprocessed_html.str.find("

") == std::string::npos) { + preprocessed_html.str.reserve(preprocessed_html.str.size() + 3 + 4); + preprocessed_html.str.insert(0, "

"); + preprocessed_html.str.append("

"); + } + Element contents("div", {{"class", "post-contents"}}, {std::move(preprocessed_html)}); Element post_attachments("div", {{"class", "post-attachments"}}, {}); post_attachments.nodes.reserve(post.media_attachments.size());