You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is valid HTML, but if I try to display the svg in Safari, it doesn't render correctly.
Apparently Safari needs a trailing slash for path, like so:
That is the exact reason I did not include SVG stuff yet, because it behaves differently in subtle ways. HTML "prefers" no trailing slash for unpaired tags, but XML-like things like SVG require them....
So I wasn't sure if adding svg into the regular some HTML system is a good idea, or rather have a completely separate SVGBuilder approach. Also, the global namespace is littered enough as it is already by importing Elementary in a file, adding all the svg tags as well feels a bit much to me - especially since they can only be used within very narrow constraints.
In my projects, I just include things like
HTMLRaw("svg \(withParameters) goes here")
but that's obviously not the nicest.
Pro tip, for better (static) svg caching I use this trick actually (loads the actual svg from a cache-controlled file)
First off, thanks for starting this library. I'm currently experimenting with it to generate HTML pages with swift, and ran across an issue:
I created a custom
path
element to write inline svg:I can then write simple
svg
content:Once I render this, it produces the following HTML:
I think this is valid HTML, but if I try to display the svg in Safari, it doesn't render correctly.
Apparently Safari needs a trailing slash for
path
, like so:Is there a way to force certain void elements to add a trailing slash when rendering? Or should I use a different approach?
I guess the alternative would be to use
HTMLTrait.Paired
instead ofHTMLTrait.Unpaired
, but that would make the HTML less compact.The text was updated successfully, but these errors were encountered: