Add check for nothingness to link_or_text!

Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
pull/3/head
parent 6c8268f50c
commit 6152004356
Signed by: millironx
GPG Key ID: 139C07724802BC5D

@ -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

Loading…
Cancel
Save