https://github.com/simonfelding/markdown-table-repair
Markdown tables are pretty fragile. This script can add the formalities to make a | seperated markdown table work.
https://github.com/simonfelding/markdown-table-repair
Last synced: about 1 month ago
JSON representation
Markdown tables are pretty fragile. This script can add the formalities to make a | seperated markdown table work.
- Host: GitHub
- URL: https://github.com/simonfelding/markdown-table-repair
- Owner: simonfelding
- Created: 2021-03-04T13:51:10.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-04T14:37:21.000Z (over 5 years ago)
- Last Synced: 2025-02-22T21:30:16.769Z (over 1 year ago)
- Language: Python
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# markdown-table-repair
Markdown tables are pretty fragile. This script can add the formalities to make a | seperated markdown table work.
Top row dictates size of table.
## example
this table is broken: 1. extra whitespace in Characteristics cell, 2. too few dashes in second row, 3. Respondents row has 4 cells instead of five:
```
| #Table 1. Characteristics of the sample | | | | |
|-------------------------------------|-----|------|------------|------------|
| Characteristic | n | % | weighted n | weighted % |
| Respondents | 123 | n/a | 1.234.567 |
```
The script detects and removes the errors, outputting a markdown table suitable for sensitive stuff like https://github.com/Zettlr/Zettlr
```
| #Table 1. Characteristics of the sample | | | | |
|-----------------------------------------|-----|------|------------|------------|
| Characteristic | n | % | weighted n | weighted % |
| Respondents | 123 | n/a | 1.234.567 | |
```
It will also transform this
```
| table 1 | 11 | 2222 | 3333333 |
|-|-|-|-|
| test | hi | to | you |
```
to this
```
| table 1 | 11 | 2222 | 3333333 |
|---------|----|------|---------|
| test | hi | to | you |
```
not sure if it's needed.