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

v0.3.0 broke dedent package #44

Open
lukasmalkmus opened this issue Sep 29, 2021 · 0 comments
Open

v0.3.0 broke dedent package #44

lukasmalkmus opened this issue Sep 29, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@lukasmalkmus
Copy link
Contributor

lukasmalkmus commented Sep 29, 2021

Assume the following (in real life dynamically created) string:

Your bank accounts:

  DKB
    ✓ Logged in as jamesbond
  ING
    ✓ Logged in as jamesbond

The indentation is there for a reason. At one stage a special character is inserted to denote the selected bank account (if an account is actually selected):

Your bank accounts:

➜ DKB
    ✓ Logged in as jamesbond
  ING
    ✓ Logged in as jamesbond

Regardless if an account is selected or not, this is run through dedent.String() to get rid of the indentation of the first example above.

With v0.2.0 and v0.3.0, this works fine:

Your bank accounts:

DKB
  ✓ Logged in as jamesbond
ING
  ✓ Logged in as jamesbond

However, when the arrow is present as in the second example above, dedentation gets mangled with v0.3.0:

Your bank accounts:

➜DKB
  ✓ Logged in as jamesbond
ING
  ✓ Logged in as jamesbond

Not even the whitespace between the char and the next string is preserved.

To sum this up and give a working example, try the following code with v0.2.0 and v0.3.0:

const s = `Your bank accounts:

➜ DKB
    ✓ Logged in as jamesbond
  ING
    ✓ Logged in as jamesbond
`

fmt.Print(dedent.String(s))
@muesli muesli added the bug Something isn't working label Feb 7, 2022
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

2 participants