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

Remove trailing spaces on empty lines in interpolated text #37

Open
rattrayalex opened this issue Dec 29, 2022 · 0 comments
Open

Remove trailing spaces on empty lines in interpolated text #37

rattrayalex opened this issue Dec 29, 2022 · 0 comments

Comments

@rattrayalex
Copy link

See indentjs/endent#12 for an example failing test.

const insertion = "indented 1\n\nindented 2";
const output = endent`
  foo
    ${insertion}
`;
const current = output === "foo\n  indented 1\n  \n  indented 2"
const desired = output === "foo\n  indented 1\n\n  indented 2"

I have worked around this by tacking .replaceAll(/\n\s*\n/gi, '\n\n') at the end of our dedent() calls in a wrapper function.

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

No branches or pull requests

1 participant