Skip to content

Tabs before colons in keky:values are rejected, but only sometimes #675

@eugenesvk

Description

@eugenesvk

Describe the bug
Tab before colon in key:value pairs is rejected, but only in some cases (and it shouldn't be)

To Reproduce

This is fine: 1 tab 1 tab before : https://goccy.github.io/go-yaml/?content=ZGF0YToNCiAgMU9rVGFiCTogJ2EnDQogIDJPa1RhYgk6ICdhJw==

data:
  1OkTab	: 'a'
  2OkTab	: 'a'

This bugs: 1 space 1 tab https://goccy.github.io/go-yaml/?content=ZGF0YToNCiAgMU9rU3BhY2UgOiAnYScNCiAgMkJ1Z1RhYgk6ICdhJw==

data:
  1OkSpace : 'a'
  2BugTab	: 'a'

This bugs again: 1 tab, 1 tab, 2 tabs https://goccy.github.io/go-yaml/?content=ZGF0YToNCiAgMU9rVGFiCTogJ2EnDQogIDJPa1RhYgk6ICdhJw0KICAzQnVnMlRhYgkJOiAnYSc=

data:
  1OkTab	: 'a'
  2OkTab	: 'a'
  3Bug2Tab		: 'a'

Expected behavior
Tab is always accepted

Screenshots
N/a

Version Variables
Using it via Chezmoi, not sure which versions they use

  • Go version: [e.g. 1.21 ]
  • go-yaml's Version: [e.g. v1.11.1 ]

Additional context
Chezmoi switch to this library broke configs accepted by another go yaml library
twpayne/chezmoi#4323

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingparser

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions