diff --git a/include/toml11/parser.hpp b/include/toml11/parser.hpp index 5952f99..8b60810 100644 --- a/include/toml11/parser.hpp +++ b/include/toml11/parser.hpp @@ -1855,7 +1855,14 @@ skip_multiline_spacer(location& loc, context& ctx, const bool newline_found { spacer.newline_found = true; auto comment = comm.as_string(); - if( ! comment.empty() && comment.back() == '\n') {comment.pop_back();} + if( ! comment.empty() && comment.back() == '\n') + { + comment.pop_back(); + if (!comment.empty() && comment.back() == '\r') + { + comment.pop_back(); + } + } spacer.comments.push_back(std::move(comment)); spacer.indent_type = indent_char::none;