Skip to content

Commit

Permalink
Merge pull request #7 from kdheepak/kd/fix-link-convert
Browse files Browse the repository at this point in the history
Fix bug in link convert
  • Loading branch information
kdheepak authored Oct 2, 2019
2 parents 0e4e6a5 + 7e4b929 commit 952fd3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Pandoc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ function Base.convert(::Type{Link}, e::Markdown.Link)
text = if e.text isa AbstractString
e.text
else
length(e.text) > 0 : e.text[1] : ""
length(e.text) > 0 ? e.text[1] : ""
end
for s in split(text)
push!(content, convert(Str, s))
Expand Down
11 changes: 11 additions & 0 deletions test/test_pandoc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ end
)
)

@test (
convert(Pandoc.Link, Markdown.Link(Any["title"], "https://example.com"))
==
Pandoc.Link(
Pandoc.Attributes(),
Pandoc.Inline[Pandoc.Str("title")],
Pandoc.Target("https://example.com", ""),
)
)


@test (
convert(Pandoc.Strong, Markdown.Bold(["bold"]))
==
Expand Down

0 comments on commit 952fd3f

Please sign in to comment.