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

Bad Formatting Due To Unicode U+200B #2675

Open
korverdev opened this issue Dec 6, 2021 · 0 comments
Open

Bad Formatting Due To Unicode U+200B #2675

korverdev opened this issue Dec 6, 2021 · 0 comments
Labels
T: bug Something isn't working

Comments

@korverdev
Copy link
Contributor

Describe the bug

Black adds unexpected indent to docstrings when previous lines contains a zero-width space character.

To Reproduce

Run Black on the following code:

class Test:
    def test(self) -> None:
        """Test.

        Testing...

        Testing...

        Testing...
        """

This results in the following formatting:

class Test:
    def test(self) -> None:
        """Test.

                Testing...

                Testing...

                Testing...
        """

Expected behavior

I would expect this to format as it would without the zero-width space characters, keeping the same indent level as the unformatted code.

Environment

  • Black's version: 21.9b0
  • OS and Python version: OSX/Python 3.9.7

Additional context

N/A

@korverdev korverdev added the T: bug Something isn't working label Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant