swhitty / SwiftDraw

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

Fix: use should find any element #44

Closed swhitty closed 5 months ago

swhitty commented 5 months 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.