Skip to content

Commit

Permalink
fix markdown parser failed for tables with no first column (JuliaLang…
Browse files Browse the repository at this point in the history
  • Loading branch information
p1scescom committed Nov 21, 2020
1 parent 5bfad56 commit 8de4268
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion stdlib/Markdown/src/GitHub/table.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function github_table(stream::IO, md::MD)
align = nothing
while (row = parserow(stream)) !== nothing
if length(rows) == 0
isempty(row[1]) && return false
cols = length(row)
end
if align === nothing && length(rows) == 1 # Must have a --- row
Expand Down
6 changes: 6 additions & 0 deletions stdlib/Markdown/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,12 @@ foo()
["hgh",Bold("jhj"),"ge"],
"f"]],
[:l, :r, :r]))
@test md"""
| | b |
|:--|--:|
| 1 | |""" == MD(Table(Any[[Any[],"b"],
["1",Any[]]], [:l, :r]))

@test md"""
no|table
no error
Expand Down

0 comments on commit 8de4268

Please sign in to comment.