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

Allow disabling single & block quotes completely #326

Merged
merged 3 commits into from
Nov 7, 2021
Merged

Allow disabling single & block quotes completely #326

merged 3 commits into from
Nov 7, 2021

Conversation

eemeli
Copy link
Owner

@eemeli eemeli commented Nov 1, 2021

This PR contains a breaking change for how singleQuote: false is handled. To retain the previous behaviour, use singleQuote: null instead or leave the option unset.

Adds a ToString option blockQuote: boolean | 'folded' | 'literal' and expands singleQuote: boolean | null, such that using false for either prevents that scalar style from being used at all in the output.

For blockQuote, setting either the 'folded' or 'literal' style will use it for all scalar values for which block quotes are used.

For singleQuote, the default null value will prefer double-quoted but allow single-quoted where aesthetically more pleasing. Setting this to true will prefer single-quoted instead.

It is intentional that no option exists for disabling plain or double-quoted scalar styles, as they're required for properly representing all scalar values.

@eemeli eemeli merged commit 5c50475 into master Nov 7, 2021
@eemeli eemeli deleted the quotey branch November 7, 2021 14:54
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.

1 participant