Skip to content

Markdown tables are pretty fragile. This script can add the formalities to make a | seperated markdown table work.

Notifications You must be signed in to change notification settings

simonfelding/markdown-table-repair

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

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.

About

Markdown tables are pretty fragile. This script can add the formalities to make a | seperated markdown table work.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages