Svg.use.expand: def of gralha-svg-render@0.1.0.1 Import: import gralha-svg-render@0.1.0.1/svg.bend as Svg Lines 2793-2803 of gralha-svg-render@0.1.0.1/svg.bend: https://jend.leeeet.dev/read.txt?path=gralha-svg-render@0.1.0.1/svg.bend&start_line=2793&end_line=2803 import Base import gralha-text-scan@0.1.0.1/scan.bend as U import gralha-xml-doc@0.1.0.1/xml.bend as XML import gralha-css-style@0.1.0.1/css.bend as CSS def use.expand(+fuel: Nat, +xs: List<&2, XML.Element>, +all: List<&2, XML.Element>, +ancestors: List<&2, String>) -> List<&2, XML.Element>: match fuel xs: case 0n _: Nil{} case 1n+d Nil{}: Nil{} case 1n+d Con{XML.Element{n, attrs, kids, txt}, rest}: +as = attrs +tagname = n +parents = {Con{XML.attr.get(as, "id", ""), ancestors} : List<&2, String>} Con{XML.Element{tagname, as, U.branch(List<&2, XML.Element>, U.string.equal(tagname, "use"), _ => use.children(CSS.properties(as), all, parents, nodes => use.expand(d, nodes, all, parents)), _ => use.expand(fuel, kids, U.choose(List<&2, XML.Element>, U.string.equal(tagname, "#svg-image"), kids, all), U.choose(List<&2, String>, U.string.equal(tagname, "#svg-image"), Nil{}, parents))), txt}, use.expand(fuel, rest, all, ancestors)} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=gralha-css-style@0.1.0.1/css.bend&name=properties https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=use.children https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=string.equal https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=Element https://jend.leeeet.dev/definition.txt?path=gralha-xml-doc@0.1.0.1/xml.bend&name=attr.get