showdown icon indicating copy to clipboard operation
showdown copied to clipboard

[GFM] Table delimiter row requires more than one `-` in each cell.

Open ghost opened this issue 4 years ago • 2 comments

Does not support table

showdown.setOption('tables', true);
showdown.setOption('tablesHeaderId', true);

var converter = new showdown.Converter(),
text      = `|a|b|c|d|
|:-|:-:|:-:|-:|
|1|2|3|4|`,
						 html      = converter.makeHtml(text);
						$ ('[data]') .html (html)

ghost avatar Oct 17 '21 08:10 ghost

More than one dash is required in the line between table headers and table body. The following works:

| a  | b   | c   | d  |
| :-- | :--: | :--: | --: |
| 1  | 2   | 3   | 4  |

Preview:

a b c d
1 2 3 4

According to GFM, one dash tables should be allowed: https://github.github.com/gfm/#tables-extension-

SyntaxRules avatar Nov 29 '21 16:11 SyntaxRules