Fix issue with --- in the middle of a scalar.

This issue arises in the `yaml-test-suite` not in a test, but rather in
the test description files themselves. Since we now use the library
itself to load the test files, this made the `yaml-test-suite` fail.
This commit is contained in:
Ethiraric 2024-10-13 16:19:57 +02:00
parent dc429b7ef7
commit 95fe3fea16

View file

@ -2176,7 +2176,10 @@ impl<T: Input> Scanner<T> {
loop {
self.input.lookahead(4);
if self.input.next_is_document_indicator() || self.input.peek() == '#' {
if self.input.next_is_document_end()
|| (self.input.next_is_document_start() && self.leading_whitespace)
|| self.input.peek() == '#'
{
break;
}