1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-11-23 00:33:44 +00:00

Eat up the newline following the html comment.

This commit is contained in:
King_DuckZ 2017-06-19 20:19:51 +01:00
parent 9c0734c31d
commit eb02bd617b

View file

@ -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);
}
}