Properly allow a trailing tab character on a block scalar (#919)

Fixes #917
This commit is contained in:
Chen
2020-07-16 23:08:09 +08:00
committed by GitHub
parent 51ce663085
commit c3df6d87d4
2 changed files with 6 additions and 1 deletions

View File

@@ -204,7 +204,7 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
// post-processing
if (params.trimTrailingSpaces) {
std::size_t pos = scalar.find_last_not_of(' ');
std::size_t pos = scalar.find_last_not_of(" \t");
if (lastEscapedChar != std::string::npos) {
if (pos < lastEscapedChar || pos == std::string::npos) {
pos = lastEscapedChar;