Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tablefix #225

Merged
merged 3 commits into from
Sep 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/converter/md.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,14 @@ function form_inter_md(mds::AS, blocks::Vector{<:AbstractBlock},
if isa(β, OCBlock) && β.name ∈ MD_OCB_IGNORE
head = nextind(mds, to(β))
else
write(intermd, INSERT)
if isa(β, OCBlock) && β.name ∈ MD_HEADER
# this is a trick to allow whatever follows the title to be
# properly parsed by Markdown.parse; it could otherwise cause
# issues for instance if a table starts immediately after the title
write(intermd, INSERT * "\n ")
else
write(intermd, INSERT)
end
push!(mblocks, β)
head = nextind(mds, to(blocks[b_idx]))
end
Expand Down
20 changes: 20 additions & 0 deletions test/global/cases2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,23 @@ end
<p>The end.</p>
""")
end


@testset "Table" begin
st = """
A

### Title

No. | Graph | Vertices | Edges
:---: | :---------: | :------------: | :-----------------:
1 | Twitter Social Circles | 81,306 | 1,342,310
2 | Astro-Physics Collaboration | 17,903 | 197,031
3 | Facebook Social Circles | 4,039 | 88,234

C
""" * J.EOS
st |> seval

st |> Markdown.parse
end