diff --git a/Project.toml b/Project.toml index 2fa14a9..d9bafb6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Gumbo" uuid = "708ec375-b3d6-5a57-a7ce-8257bf98657a" -version = "0.8.2" +version = "0.8.3" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" diff --git a/src/manipulation.jl b/src/manipulation.jl index e347053..03cd913 100644 --- a/src/manipulation.jl +++ b/src/manipulation.jl @@ -42,7 +42,7 @@ function text(el::HTMLElement) io = IOBuffer() for c in AbstractTrees.PreOrderDFS(el) if c isa HTMLText - print(io, c.text, ' ') + print(io, c.text) end end diff --git a/test/manipulation.jl b/test/manipulation.jl new file mode 100644 index 0000000..7557fa4 --- /dev/null +++ b/test/manipulation.jl @@ -0,0 +1,7 @@ +@testset "`text`" begin + doc = parsehtml("foobarbaz") + @test text(doc.root) == "foobarbaz" + + doc = parsehtml("MoSe2") + @test text(doc.root) == "MoSe2" +end \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 91cd34c..b989ede 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,3 +6,4 @@ include("comparison.jl") include("parsing.jl") include("traversal.jl") include("io.jl") +include("manipulation.jl") \ No newline at end of file