Skip to content

quoted-strings: Fix only-when-needed on multiline with backslash#746

Merged
adrienverge merged 1 commit intomasterfrom
fix/275
May 4, 2025
Merged

quoted-strings: Fix only-when-needed on multiline with backslash#746
adrienverge merged 1 commit intomasterfrom
fix/275

Conversation

@adrienverge
Copy link
Copy Markdown
Owner

On double-quoted multiline strings, quotes aren't needed if lines are broken on spaces, e.g.:

multiline:
  "this is a sentence
  cut into words"

But quotes are needed when at least one line ends with a backslash character (\), meaning that the next spaces should be removed:

multiline:
  "https://example.com/a/very/very\
  /very/very/long/URL"

This commit fixes that.

Fixes #275

On double-quoted multiline strings, quotes aren't needed if lines are
broken on spaces, e.g.:

    multiline:
      "this is a sentence
      cut into words"

But quotes are needed when at least one line ends with a backslash
character (`\`), meaning that the next spaces should be removed:

    multiline:
      "https://example.com/a/very/very\
      /very/very/long/URL"

This commit fixes that.

Fixes #275
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 99.815%. remained the same
when pulling cd869f0 on fix/275
into 2d10aaa on master.

@adrienverge adrienverge merged commit 1a6542c into master May 4, 2025
18 checks passed
@adrienverge adrienverge deleted the fix/275 branch May 4, 2025 08:10
@adrienverge
Copy link
Copy Markdown
Owner Author

adrienverge commented May 4, 2025

See #742 (comment).

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.

quoted-strings only-when-needed doesn't work properly for multiline strings

2 participants