profile
viewpoint

Ask questionsv3: Invalid output (bad indentation) when an indentation indicator/hint is used in a scalar block

The indentation change in https://github.com/go-yaml/yaml/commit/a5ece683394c3b88d90572e44d36c93aea492c2c is causing invalid output when an indentation indicator/hint is used in a scalar block: https://play.golang.org/p/tbWDmsaqANV

for:

yaml.Marshal([]string{" hello\world"})

expecting:

- |4-
     hello
    world

got:

- |4-
   hello
  world

which is invalid and cannot be parsed.

This relates to #633 and I had commented about it there, but invalid output is more severe than unpleasant indentation... so I figured it deserved a separate issue.

go-yaml/yaml

Answer questions niemeyer

Thanks for the report and PR. I'll look into those.

Meanwhile, have you signed the contributor agreement (https://ubuntu.com/legal/contributors)?

It's easy to sign online and the text should be very reasonable hopefully.

useful!

Related questions

v3 panics on bad input hot 1
v3 equivalent of v2's MapSlice and MapItem? hot 1
unmarshal with comments provide wrong structure hot 1
Head comments in list elements misplaced hot 1
source:https://uonfu.com/
Github User Rank List