Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: scalar indent indicator [#643] #864

Open
wants to merge 3 commits into
base: v3
Choose a base branch
from

Conversation

hedhyw
Copy link

@hedhyw hedhyw commented Jun 10, 2022

Fixes #643

The library can produce invalid YAML (yaml.Marshal([]string{" hello\nworld"})):

- |4-
   hello
  world

The indention is 2, but the indicator shows 4-.

This PR fixes this behaviour.

emitterc.go Outdated Show resolved Hide resolved
@hedhyw hedhyw force-pushed the fix/indent-indicator branch from 18a3b13 to bede512 Compare February 19, 2023 12:55
@hedhyw hedhyw changed the title Fix scalar indent indicator [#643] fix: scalar indent indicator [#643] Feb 19, 2023
@hedhyw hedhyw requested a review from emanlodovice February 19, 2023 12:56
Copy link

@emanlodovice emanlodovice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@emanlodovice
Copy link

Approved the PR but I am not a maintainer 😅

@emanlodovice
Copy link

@niemeyer please take a look when you have time. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v3: Invalid output (bad indentation) when an indentation indicator/hint is used in a scalar block
2 participants