Skip to content

Commit

Permalink
Tablefix (#225)
Browse files Browse the repository at this point in the history
* fixes to headers and toc and internal links

* fixes for JDINSERT followed by line return
  • Loading branch information
tlienart authored Sep 21, 2019
1 parent c173e55 commit faa30e2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
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

0 comments on commit faa30e2

Please sign in to comment.