Documentation
¶
Overview ¶
Package dataurl encodes resources as data URLs, choosing the representation that compresses best for SVG and base64 for everything else.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode returns the payload and media type of a data URL. A fragment, which references a part of the resource, is ignored.
func Encode ¶
Encode returns a data URL for contents of media type kind and the encoding used: "percent" (lossless SVG text) or "base64".
func SVG ¶
SVG encodes bytes, not XML: decoding must recover the original file byte-for-byte, including Unicode/encoding declarations, whitespace, IDs and fragment refs. This alphabet survives HTML attributes, srcset, either JS/CSS string delimiter and unquoted CSS url(). In particular %, #, comma, &, quotes and backslashes must never become ambiguous payload, markup, escapes or URL fragments.
Types ¶
This section is empty.