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

Format Table adds needless space to explicitly aligned columns #1005

Closed
jbridgy opened this issue Feb 5, 2023 · 1 comment
Closed

Format Table adds needless space to explicitly aligned columns #1005

jbridgy opened this issue Feb 5, 2023 · 1 comment
Assignees
Labels

Comments

@jbridgy
Copy link

jbridgy commented Feb 5, 2023

The following examples in fenced code blocks demonstrate how the Format Table command of MM v2.8.2.6 adds a needless space to each explicitly aligned column, no matter whether left, right or center.

When the code fences are removed then all examples (before and after applying Format Table) are rendered correctly by MM, GitHub, GitLab, Azure DevOps and typora v1.5.5.

Case 1: Table with implicitly left-aligned columns (default)

Before Format Table:

| # | Column 2 | Column 3 |
|---|----------|----------|
| 1 | bla      | bla      |
| 2 | bla      | bla      |

After Format Table (OK, unchanged):

| # | Column 2 | Column 3 |
|---|----------|----------|
| 1 | bla      | bla      |
| 2 | bla      | bla      |

Case 2: Table with explicitly left-aligned columns

Before Format Table:

| # | Column 2 | Column 3 |
|:--|:---------|----------|
| 1 | bla      | bla      |
| 2 | bla      | bla      |

After Format Table (BAD, needless spaces added):

| #  | Column 2  | Column 3 |
|:---|:----------|----------|
| 1  | bla       | bla      |
| 2  | bla       | bla      |

Case 3: Table with right-aligned columns

Before Format Table:

| # | Column 2 | Column 3 |
|--:|---------:|----------|
| 1 | bla      | bla      |
| 2 | bla      | bla      |

After Format Table (BAD, needless spaces added):

| #  | Column 2  | Column 3 |
|---:|----------:|----------|
| 1  | bla       | bla      |
| 2  | bla       | bla      |

Case 4: Table with centered columns

Before Format Table:

| # | Column 2 | Column 3 |
|:-:|:--------:|----------|
| 1 | bla      | bla      |
| 2 | bla      | bla      |

After Format Table (BAD, needless spaces added):

| #   | Column 2   | Column 3 |
|:---:|:----------:|----------|
| 1   | bla        | bla      |
| 2   | bla        | bla      |
@RickStrahl
Copy link
Owner

RickStrahl commented Feb 6, 2023

Fixed.

Thank you for the detailed report.

Before:

| # | Column 2 | Column 3 |
|:--|:---------|----------|
| 1 | bla  s    | bla    d  |
| 2 | bla sda     | bla d     |

After table format:

| # | Column 2 | Column 3 |
|:--|:---------|----------|
| 1 | bla  s   | bla    d |
| 2 | bla sda  | bla d    |

@RickStrahl RickStrahl self-assigned this Feb 6, 2023
@RickStrahl RickStrahl added the bug label Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants