From eb02bd617b59bfa07f91655689ac08872d831681 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Mon, 19 Jun 2017 20:19:51 +0100 Subject: [PATCH] Eat up the newline following the html comment. --- src/kamokan_impl/pastie_response.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kamokan_impl/pastie_response.cpp b/src/kamokan_impl/pastie_response.cpp index 92b1de7..585071c 100644 --- a/src/kamokan_impl/pastie_response.cpp +++ b/src/kamokan_impl/pastie_response.cpp @@ -59,7 +59,8 @@ namespace kamokan { if (parPastie.npos != comment_start) { const auto comment_len = parPastie.find("-->") - comment_start + 3; retval.comment = parPastie.substr(comment_start, comment_len); - parPastie.erase(comment_start, comment_len); + const std::size_t newline = (comment_len + 1 < parPastie.size() and parPastie[comment_len] == '\n' ? 1 : 0); + parPastie.erase(comment_start, comment_len + newline); } }