Skip to content

Commit 6279c73

Browse files
CaldrinLeont
authored andcommitted
accept YAML with trailing whitespace in header
YAML with a header that has trailing whitespace (i.e. '--- ' instead of '---') is incorrectly treated as inline YAML. This fails since the footer ('...') is not found on the same line. Whitespace after the header is valid and needs to be treated correctly.
1 parent 64f1ff0 commit 6279c73

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Revision history for Test-Harness
2+
- Accept YAML with trailing whitespace in header (Maik Hentsche)
23
- Stop bundling Test::More for testing
34

45
3.35 2015-01-14

lib/TAP/Parser/YAMLish/Reader.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ sub _read {
8181
my $line = $self->_peek;
8282

8383
# Do we have a document header?
84-
if ( $line =~ /^ --- (?: \s* (.+?) \s* )? $/x ) {
84+
if ( $line =~ /^ --- (?: \s* (.+?)? \s* )? $/x ) {
8585
$self->_next;
8686

8787
return $self->_read_scalar($1) if defined $1; # Inline?

0 commit comments

Comments
 (0)