1
0
Fork 0
mirror of https://github.com/MillironX/Kelpie.jl.git synced 2024-11-14 21:43:10 +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,11 +83,13 @@ julia> prettyprint(link_or_text!(ElementNode("div"), "The end", ElementNode("hr"
""" """
function link_or_text!(node, content...) function link_or_text!(node, content...)
for con in content for con in content
if !isnothing(con)
if typeof(con) <: EzXML.Node if typeof(con) <: EzXML.Node
link!(node, con) link!(node, con)
else else
link!(node, EzXML.TextNode(string(con))) link!(node, EzXML.TextNode(string(con)))
end #if end #if
end #if
end #for end #for
return node return node