diff --git a/routes/user.cpp b/routes/user.cpp index 7cb80b7..e6131e0 100644 --- a/routes/user.cpp +++ b/routes/user.cpp @@ -82,6 +82,14 @@ static inline PostSortingMethod get_sorting_method(const std::string& method) { static inline Element user_header(const httplib::Request& req, const std::string& server, const Account& account, PostSortingMethod sorting_method) { + blankie::html::HTMLString preprocessed_bio = preprocess_html(req, account.server, account.emojis, account.note_html); + // Workaround for https://social.kernel.org/@monsieuricon + if (preprocessed_bio.str.find("
") == std::string::npos) { + preprocessed_bio.str.reserve(preprocessed_bio.str.size() + 3 + 4); + preprocessed_bio.str.insert(0, "
"); + preprocessed_bio.str.append("
"); + } + Element user_links("table", {{"class", "user_page-user_links"}}, {}); user_links.nodes.reserve(account.fields.size()); for (const AccountField& i : account.fields) { @@ -113,7 +121,7 @@ static inline Element user_header(const httplib::Request& req, const std::string }), Element("div", {{"class", "user_page-user_description"}}, { - Element("div", {{"class", "user_page-user_bio"}}, {preprocess_html(req, account.server, account.emojis, account.note_html)}), + Element("div", {{"class", "user_page-user_bio"}}, {std::move(preprocessed_bio)}), std::move(user_links), }),