diff --git a/server/src/post.cpp b/server/src/post.cpp index 4061e73..7840318 100644 --- a/server/src/post.cpp +++ b/server/src/post.cpp @@ -1,20 +1,23 @@ #include "post.h" #include +#include #include #include #include #include +std::regex tags("<[^<]*>"); + Post::Post(const std::string& contentin, const std::string& user) : user(user), time(std::time(nullptr)) { // parse the post content markdown - std::stringstream input(contentin); + std::stringstream input(std::regex_replace(contentin, tags, "")); std::shared_ptr parser = std::make_shared(); content = parser->Parse(input); } Post::Post(const std::string& contentin, uint64_t user) : userId(user), time(std::time(nullptr)) { // parse the post content markdown - std::stringstream input(contentin); + std::stringstream input(std::regex_replace(contentin, tags, "")); std::shared_ptr parser = std::make_shared(); content = parser->Parse(input); }