Encode markup instead of inserting raw angle brackets into a URL
Example input
<svg/>Expected result
data:image/svg+xml,%3Csvg%2F%3EThe minimal sample demonstrates the encoding and is not a useful drawing. The angle brackets and slash become percent-encoded bytes after the SVG media-type prefix. For an actual icon, include the correct SVG namespace, viewBox and artwork in the source, then test the complete URI in the destination where it will be used.