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

Improve table insertion command #373

Merged
merged 2 commits into from
Nov 12, 2018

Conversation

saf-dmitry
Copy link
Contributor

@saf-dmitry saf-dmitry commented Nov 7, 2018

Description

  • Fix column alignment specification
  • Make specifying of columnt alignment more robust and user-friendly
  • Refactor table insertion code

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves an existing feature)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have updated the documentation in the README.md file if necessary.
  • I have added an entry to CHANGES.md.
  • I have added tests to cover my changes.
  • All new and existing tests passed (using make test).

saf-dmitry referenced this pull request Nov 7, 2018
1. Define column size
2. Define row size
3. Define align type (left, right or center)
4. Define headers
@jrblevin
Copy link
Owner

There is an error (continuous integration checks failing) since the tests that were added in the previous implementation of this function are now failing, so I can't quite merge yet.

@saf-dmitry
Copy link
Contributor Author

I updated tests, but the continuous integration checks failing error is still there. Need help.

@jrblevin jrblevin merged commit 02d68d7 into jrblevin:master Nov 12, 2018
@jrblevin
Copy link
Owner

Thanks for the PR and the update. The error was because the tests still weren't passing due to a small whitespace difference in the tables expected by the tests. The actual inserted tables were of this form:

|  |  |
|--:|--:|
|   |   |
|   |   |

But the tests were expecting them to be of this form:

|   |   |
|--:|--:|
|   |   |
|   |   |

I updated the code in d18a8f8 to add the extra space. I also updated the alignment prompt slightly and moved the point to the first column for text insertion.

Thanks again for the patch and let me know if you see any other issues.

@saf-dmitry
Copy link
Contributor Author

saf-dmitry commented Nov 12, 2018

Tnanks for the prompt help and fixing. Now I can see the original problem: When a table was inserted at the first buffer line, then markdown-table-begin function had a problem to detect the beginning of table (it needs at least one blank line before the table), and the first table row was not aligned properly. Maybe we should fix the markdown-table-begin function in the future updates.

jrblevin added a commit that referenced this pull request Dec 14, 2018
@jrblevin
Copy link
Owner

jrblevin commented Dec 14, 2018

Thanks for figuring that out. I think this should do it: 986d317

I also updated the test here: 906e97d

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

Successfully merging this pull request may close these issues.

2 participants