YamlDotNet
YamlDotNet copied to clipboard
Single and Double Colon causes SemanticErrorException
Describe the bug I have a file which has a value with two continuous colons, which is a valid YAML value, yet whenever parsing it with this library, it's giving me a SemanticErrorException error.
To Reproduce The YAML I'm currently using is:
ipv4_bind_ip: 0.0.0.0
ipv6_bind_ip: ::
The exception I get is
YamlDotNet.Core.SemanticErrorException: '(Line: 2, Col: 16, Idx: 38) - (Line: 2, Col: 16, Idx: 38): While scanning a plain scalar value, found invalid mapping.'
For the record, I also tried saving the value as a single colon, which is as well a valid YAML format, and gave me an error as well.
ipv4_bind_ip: 0.0.0.0
ipv6_bind_ip: :
The same also happens if a string starts with a %, though the exception is different:
YamlDotNet.Core.SyntaxErrorException: '(Line: 1, Col: 38, Idx: 37) - (Line: 1, Col: 39, Idx: 38): While scanning for the next token, found character that cannot start any token.'
with the following file:
ff_detector_round_adminchat_message: %nick has been banned for teamkilling (round detector).