Skip to content

fix(style): preserve word separation when Inline replaces newlines - #733

Open
beltagyy wants to merge 1 commit into
charmbracelet:mainfrom
beltagyy:fix/inline-newline-spacing
Open

fix(style): preserve word separation when Inline replaces newlines#733
beltagyy wants to merge 1 commit into
charmbracelet:mainfrom
beltagyy:fix/inline-newline-spacing

Conversation

@beltagyy

Copy link
Copy Markdown

When Inline mode encounters multi-line strings it strips \n characters but concatenates the last word of one line with the first word of the next.

This change replaces newlines with a single space so that

style.Render("hello\nworld")

produces "hello world" instead of "helloworld".

Adds a focused test for the new behaviour (hello\nworld, CRLF, and single-word inputs).

Fixes #116

When Inline mode encounters multi-line strings it strips \n characters
but concatenates the last word of one line with the first word of the
next.  Replace newlines with a single space so that

    style.Render("hello\nworld")

produces "hello world" instead of "helloworld".

Fixes charmbracelet#116
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.

Inline concatenates words from multiple lines

1 participant