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

Line breaks in string values are gradually erased #69

Open
1 task done
evelynn-causemic opened this issue May 26, 2023 · 0 comments
Open
1 task done

Line breaks in string values are gradually erased #69

evelynn-causemic opened this issue May 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@evelynn-causemic
Copy link

Description

String values contained with HubL blocks gradually have any newlines removed, due to a conflict between opinionated style rules and whitespace formatting rules.

The formatter converts newline escape sequences (\n) contained within strings to line breaks when run. However, it also collapses line breaks within strings when run — this leads to all line breaks within strings being removed after the formatter is run twice.

Expected behavior

The informational content of a string should not be altered by the formatter.

To Reproduce

Use a line break or newline escape sequence within quoted text inside of a HubL block.

Original Source Code:

{% set test_value="First line\nSecond line" %}

Formatted Source Code (first run):

{% set test_value="First line
Second line" %}

Formatted Source Code (second run):

{% set test_value="First lineSecond line" %}

Checklist

  • I have checked the known issues to make sure this isn’t already a known issue.
@evelynn-causemic evelynn-causemic added the bug Something isn't working label May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant