Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaml-cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
yaml-cpp
Commits
c3df6d87
Unverified
Commit
c3df6d87
authored
Jul 16, 2020
by
Chen
Committed by
GitHub
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly allow a trailing tab character on a block scalar (#919)
Fixes #917
parent
51ce6630
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletions
+6
-1
src/scanscalar.cpp
+1
-1
test/integration/load_node_test.cpp
+5
-0
No files found.
src/scanscalar.cpp
View file @
c3df6d87
...
...
@@ -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
;
...
...
test/integration/load_node_test.cpp
View file @
c3df6d87
...
...
@@ -284,6 +284,11 @@ TEST(NodeTest, SpecialFlow) {
{
"{:a}"
,
NodeType
::
Map
,
1
,
"{:a: ~}"
},
{
"{,}"
,
NodeType
::
Map
,
1
,
"{~: ~}"
},
{
"{a:,}"
,
NodeType
::
Map
,
1
,
"{a: ~}"
},
//testcase for the trailing TAB of scalar
{
"key
\t
: value
\t
"
,
NodeType
::
Map
,
1
,
"key: value"
},
{
"key
\t
: value
\t
#comment"
,
NodeType
::
Map
,
1
,
"key: value"
},
{
"{key
\t
: value
\t
}"
,
NodeType
::
Map
,
1
,
"{key: value}"
},
{
"{key
\t
: value
\t
#comment
\n
}"
,
NodeType
::
Map
,
1
,
"{key: value}"
},
};
for
(
const
SingleNodeTestCase
&
test
:
tests
)
{
Node
node
=
Load
(
test
.
input
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment