Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add missing closing outer `</svg>` tag. - Set filename (prefixed with `svg-`) as `id` attribute instead of adding it as `class`. The `id` argument to the shortcode has precedence over the prefixed filename, so users can supply a custom `id`. - Add support for `role` attribute via the `role` argument to the shortcode. Defaults to [`role="img"`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/img_role#svg_and_roleimg) if none is provided. - Set `aria-labelledby` to`<title>` elements `id` (or the `ariaLabelledby` shortcode argument, if supplied). - Add support for the [`<desc>` element](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc) via the `desc` arg to the shortcode and sets the the corresponding `aria-describedby ` to its `id` (or the `ariaDescribedby` shortcode argument, if supplied). - Add `<title>` and `<desc>` elements as first/second (instead of last) child to the outer `<svg>` element for [backwards compatbility with SVG 1.1](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title). - Fix removal of existing attributes (ensure to only remove them from the outer `svg` element and not its children). - Improve other regular expressions to be more precise and avoid unnecessary minification.
- Loading branch information