←back to thread

Nice things with SVG

(fuma-nama.vercel.app)
571 points fmerian | 1 comments | | HN request time: 0.215s | source
Show context
LegionMammal978 ◴[] No.43666631[source]
One fun thing that can be done with SVG files: you can use entities in an inline DTD to define constants to be shared across different places in the file. You can see some great examples of this in the SVGs in David Ellsworth's "Squares in Squares" page [0].

The major browsers have no issues with this, though note that some tools like Inkscape won't parse the DTD nor expand the entities.

[0] https://kingbird.myphotos.cc/packing/squares_in_squares.html

replies(5): >>43666756 #>>43668277 #>>43668668 #>>43669828 #>>43671211 #
1. noahbald ◴[] No.43668277[source]
It might work in browsers but a lot of SVG tooling will ignore DTD because it’s a DOS risk.

E.g. Billion laughs attack https://en.wikipedia.org/wiki/Billion_laughs_attack