Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Commit 7bb573b

Browse files
author
Merten Falk
committed
Fix unintended empty leading column when using MarkdownTables.plain_text
1 parent 3c5e26d commit 7bb573b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/markdown-tables.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def self.plain_text(md_table)
4343
md_table !~ // && raise('Invalid input')
4444

4545
# Split the table into lines to get the labels, rows, and alignments.
46-
lines = md_table.split("\n")
46+
lines = md_table.split("\n").map { |l| l.gsub(/^\||\|$/, '') }
4747
alignments = lines[1].split('|')
4848
# labels or rows might have some empty values but alignments
4949
# is guaranteed to be of the right width.

0 commit comments

Comments
 (0)