Skip to content

Commit

Permalink
Filter out empty expressions in parseblock, fix #823.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Aug 29, 2018
1 parent a388bd1 commit 200df1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Utilities/Utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ function parseblock(code::AbstractString, doc, page; skip = 0, keywords = true)
break
end
end
push!(results, (ex, SubString(code, cursor, prevind(code, ncursor))))
str = SubString(code, cursor, prevind(code, ncursor))
if !isempty(strip(str))
push!(results, (ex, str))
end
cursor = ncursor
end
results
Expand Down
8 changes: 8 additions & 0 deletions test/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ end
end
end
end

@testset "issue #823" begin
for str in ("foo\r\n\r\nbar", "foo\n\nbar")
r = Documenter.Utilities.parseblock(str, nothing, nothing)
@test r[1][1] == :foo
@test r[2][1] == :bar
end
end
end

end

0 comments on commit 200df1f

Please sign in to comment.