swhitty / SwiftDraw

Swift library and command line tool to convert SVGs into SFSymbol, PNG, PDF and Swift source code.
zlib License
326 stars 41 forks source link

Fix: use should find any element #44

Closed swhitty closed 2 weeks ago

swhitty commented 2 weeks ago

Fix for https://github.com/swhitty/SwiftDraw/issues/43.

Previously <use> elements were only searching for the element within <defs> but the element to use could exist anywhere within the DOM. This change now searches <defs> first, then proceeds to recursively search the DOM for the first element that matches the id.