feat: Support YAML literal blocks for multiline strings#851
feat: Support YAML literal blocks for multiline strings#851ivov wants to merge 1 commit intomitsuhiko:masterfrom
Conversation
|
thanks for the contribution what's the standard for frontmatter — are these allowed? I agree this makes it more readable. OTOH it adds another option + introduces backward-compat issues, so need to weigh those... |
|
Thanks for the quick reply :)
Yes! Literal blocks are standard YAML so any compliant parser handles them, and frontmatter is YAML between
Added as opt-in so users control the switch. Older |
|
yes, another option would be "min-version", which we've thought about a bit before... I think the versioning is basically the only reason to have the config here; so in that case we could just adopt the "min-version" config. Or push this to #456 let me leave this open for a bit to see if others have thoughts (including @mitsuhiko ) thank you again |
Thanks for the project!
This PR adds opt-in support for YAML literal blocks for multiline strings in snapshot metadata fields like
descriptionandexpression. Trailing newlines are preserved via chomping indicators (|-,|,|+).Set
INSTA_YAML_BLOCK_STYLE=1to enable.Before:
After:
I noticed the YAML lib is vendored and assumed extending it was acceptable - please let me know if you'd prefer a different approach.
Closes #782