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

[FAILING TESTS] lines with trailing spaces #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

soenkehahn
Copy link

I created this PR instead of opening an issue, because I thought it would be easier to describe and understand. So this is not a PR submitted for merging, but a bug report.

When endent encounters spliced in text that is indented relative to other text in the template string, it inserts indentation on any newlines that appear in the spliced in text. (Which is great!) However when the spliced in text contains two (or more) consecutive newline characters, this means that the text that endent yields contains lines that contain only spaces. As far as I can tell, this is (almost?) never the desired behavior. So I think endent should not insert indentation spaces on empty lines.

foo
${insertion}
`;
expect(output).toEqual("foo\n indented 1\n\n indented 2");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity, current behavior is

"foo\n  indented 1\n  \n  indented 2"

(note the extra two spaces between the newlines)

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.

2 participants