1
0
Fork 0
mirror of https://github.com/MillironX/Kelpie.jl.git synced 2024-11-14 13:43:08 +00:00

Add check for nothingness to link_or_text!

Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
This commit is contained in:
Thomas A. Christensen II 2022-04-05 15:35:37 -05:00
parent 6c8268f50c
commit 6152004356
Signed by: millironx
GPG key ID: 139C07724802BC5D

View file

@ -83,10 +83,12 @@ julia> prettyprint(link_or_text!(ElementNode("div"), "The end", ElementNode("hr"
"""
function link_or_text!(node, content...)
for con in content
if typeof(con) <: EzXML.Node
link!(node, con)
else
link!(node, EzXML.TextNode(string(con)))
if !isnothing(con)
if typeof(con) <: EzXML.Node
link!(node, con)
else
link!(node, EzXML.TextNode(string(con)))
end #if
end #if
end #for