Skip to content

Commit 7870e49

Browse files
committed
Ensure pre-scanned tag portion is included
1 parent 3849511 commit 7870e49

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pkgs/yaml/lib/src/scanner.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,13 +1049,12 @@ class Scanner {
10491049
/// [flowSeparators] indicates whether the tag URI can contain flow
10501050
/// separators.
10511051
String _scanTagUri({String? head, bool flowSeparators = true}) {
1052-
var length = head == null ? 0 : head.length;
1053-
var buffer = StringBuffer();
1052+
final buffer = StringBuffer();
10541053

10551054
// Copy the head if needed.
10561055
//
10571056
// Note that we don't copy the leading '!' character.
1058-
if (length > 1) buffer.write(head!.substring(1));
1057+
if ((head?.length ?? 0) > 1) buffer.write(head!.substring(1));
10591058

10601059
// The set of characters that may appear in URI is as follows:
10611060
//
@@ -1075,7 +1074,7 @@ class Scanner {
10751074
}
10761075

10771076
// libyaml manually decodes the URL, but we don't have to do that.
1078-
return Uri.decodeFull(_scanner.substring(start));
1077+
return buffer.toString() + Uri.decodeFull(_scanner.substring(start));
10791078
}
10801079

10811080
/// Scans a block scalar.

0 commit comments

Comments
 (0)