diff --git a/scanner/scanner.go b/scanner/scanner.go index 8da8123..db711a6 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -940,6 +940,10 @@ func (s *Scanner) scanMapDelim(ctx *Context) (bool, error) { if s.startedFlowMapNum <= 0 && nc != ' ' && nc != '\t' && !s.isNewLineChar(nc) && !ctx.isNextEOS() { return false, nil } + if s.startedFlowMapNum > 0 && nc == '/' { + // like http:// + return false, nil + } if strings.HasPrefix(strings.TrimPrefix(string(ctx.obuf), " "), "\t") && !strings.HasPrefix(string(ctx.buf), "\t") { invalidTk := token.Invalid("tab character cannot use as a map key directly", string(ctx.obuf), s.pos()) diff --git a/yaml_test_suite_test.go b/yaml_test_suite_test.go index 187b39f..73cb459 100644 --- a/yaml_test_suite_test.go +++ b/yaml_test_suite_test.go @@ -51,7 +51,6 @@ var failureTestNames = []string{ "nested-implicit-complex-keys", // no json. "node-anchor-not-indented", // pass yamlv3. "plain-dashes-in-flow-sequence", - "plain-url-in-flow-mapping", // pass yamlv3. "question-mark-edge-cases/00", // no json. "question-mark-edge-cases/01", // no json. "scalar-value-with-two-anchors", // pass yamlv3.