From 7e4b929cc970dac4da6f07ca110b53667d17fca9 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Wed, 2 Oct 2019 03:05:37 -0600 Subject: [PATCH] Fix bug in link convert --- src/Pandoc.jl | 2 +- test/test_pandoc.jl | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Pandoc.jl b/src/Pandoc.jl index c8a983d..51a2089 100644 --- a/src/Pandoc.jl +++ b/src/Pandoc.jl @@ -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)) diff --git a/test/test_pandoc.jl b/test/test_pandoc.jl index ba0a8a7..4b6dda5 100644 --- a/test/test_pandoc.jl +++ b/test/test_pandoc.jl @@ -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"])) ==