diff --git a/toml/serializer.hpp b/toml/serializer.hpp index ed07f46..77cc71e 100644 --- a/toml/serializer.hpp +++ b/toml/serializer.hpp @@ -651,7 +651,7 @@ struct serializer tmp += '\n'; } - if(!kv.second.comments().empty() && !no_comment_) + if(!kv.second.comments().empty() && !no_comment_ && tmp.front() != '#') { for(const auto& c : kv.second.comments()) {