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

Repeated indentation #8

Closed
phenomnomnominal opened this issue Dec 12, 2015 · 8 comments
Closed

Repeated indentation #8

phenomnomnominal opened this issue Dec 12, 2015 · 8 comments

Comments

@phenomnomnominal
Copy link
Contributor

Is this test actually testing the expected behaviour:

it("works with removing same number of spaces", () => {
  const dd = require("../dedent");
  const result = dd`
                    first
                       second
                          third
                   `;
  expect(result).toBe("first\nsecond\n   third");
});

I thought this was a bug, and have a fix for it, but then there's a test for it.

I would have expected the result to be "first\n___second\n______third" (MD is eating up my whitespace).

Let me know if it is actually a bug and I'll make a PR

@dmnd
Copy link
Owner

dmnd commented Dec 12, 2015

In retrospect that test does look pretty surprising. @pratapvardhan, thoughts?

@phenomnomnominal
Copy link
Contributor Author

Any time you have a blank line, then a single indented line, then any number of subsequent lines with more indentation, the original indentation is wrong.

eg:

    some text
      more text
      more text

will become

some text
more text
more text

@phenomnomnominal
Copy link
Contributor Author

Here's a PR: #9

@phenomnomnominal
Copy link
Contributor Author

Progress on this? I'd rather depend on a real version that my fork.

@phenomnomnominal
Copy link
Contributor Author

Bump?

@dmnd
Copy link
Owner

dmnd commented Jan 20, 2016

Sorry, I'll merge & release this next chance I get. Probably 2 days from now

@phenomnomnominal
Copy link
Contributor Author

@dmnd sorry to bug you again, any chances of this happening soon?

@dmnd dmnd closed this as completed in b0d0c4c Jan 28, 2017
dmnd added a commit that referenced this issue Jan 28, 2017
@dmnd
Copy link
Owner

dmnd commented Jan 28, 2017

Sorry for the (huge) delay. Merged your PR! Thank you.

facebook-github-bot pushed a commit to facebookarchive/nuclide that referenced this issue May 16, 2018
Summary:
This updates dedent to 0.7.0. Aside from being behind, 0.7.0 is also the first to have definitions on flow-typed. These will be included in the next diff.

The only breaking change here is making dedent behave as it should in this case: dmnd/dedent#8

Reviewed By: matthewwithanm

Differential Revision: D8022381

fbshipit-source-id: ee6da0cc8d35c82453a067d94628b61b1c010f3f
hansonw pushed a commit to facebookarchive/atom-ide-ui that referenced this issue May 18, 2018
Summary:
This updates dedent to 0.7.0. Aside from being behind, 0.7.0 is also the first to have definitions on flow-typed. These will be included in the next diff.

The only breaking change here is making dedent behave as it should in this case: dmnd/dedent#8

Reviewed By: matthewwithanm

Differential Revision: D8022381

fbshipit-source-id: ee6da0cc8d35c82453a067d94628b61b1c010f3f
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

2 participants