Skip to content

fix: prevent superfluous newline for long YAML values#313

Closed
highoncomputers wants to merge 1 commit into
cdgriffith:developfrom
highoncomputers:fix/yaml-newline-long-value
Closed

fix: prevent superfluous newline for long YAML values#313
highoncomputers wants to merge 1 commit into
cdgriffith:developfrom
highoncomputers:fix/yaml-newline-long-value

Conversation

@highoncomputers

Copy link
Copy Markdown

Description

When to_yaml() is called with long string values (e.g. 2500 characters), the YAML output wraps them to the next line, producing a superfluous newline between the key and its value.

Changes

File Change
box/box.py:1024 Changed default width from 120 to 0 (no limit)
box/converters.py:200 Changed default width to 0; use None for underlying YAML libs

Before vs After

Metric Before After
YAML wrapping for long values Wraps at 120 chars No wrapping (0 = no limit)
Default behavior preserved for existing code Backward compatible (users can still pass explicit width)

Type of Change

  • Bug fix

Related Issue

Fixes #307

Increase default width to 0 (no limit) so long scalar values
are not wrapped to the next line in YAML output.

Fixes #307
@highoncomputers highoncomputers closed this by deleting the head repository Jun 22, 2026
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