1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-29 20:21:14 +03:00

Fix svg spec urls in plugins

This commit is contained in:
Bogdan Chadkin
2021-02-24 11:18:48 +03:00
parent 355fb1ff24
commit 9263d9ab90
14 changed files with 28 additions and 28 deletions

View File

@ -75,7 +75,7 @@ exports.path2js = function(path) {
data = data.map(Number);
// Subsequent moveto pairs of coordinates are threated as implicit lineto commands
// http://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands
// http://www.w3.org/TR/SVG11/paths.html#PathDataMovetoCommands
if (instruction == 'M' || instruction == 'm') {
pathData.push({
instruction: pathData.length == 0 ? 'M' : instruction,

View File

@ -9,7 +9,7 @@ exports.description = 'remove or cleanup enable-background attribute when possib
/**
* Remove or cleanup enable-background attr which coincides with a width/height box.
*
* @see http://www.w3.org/TR/SVG/filters.html#EnableBackgroundProperty
* @see http://www.w3.org/TR/SVG11/filters.html#EnableBackgroundProperty
*
* @example
* <svg width="100" height="50" enable-background="new 0 0 100 50">

View File

@ -24,8 +24,8 @@ var collections = require('./_collections'),
/**
* Convert different colors formats in element attributes to hex.
*
* @see http://www.w3.org/TR/SVG/types.html#DataTypeColor
* @see http://www.w3.org/TR/SVG/single-page.html#types-ColorKeywords
* @see http://www.w3.org/TR/SVG11/types.html#DataTypeColor
* @see http://www.w3.org/TR/SVG11/single-page.html#types-ColorKeywords
*
* @example
* Convert color name keyword to long hex:

View File

@ -9,7 +9,7 @@ exports.description = 'converts non-eccentric <ellipse>s to <circle>s';
/**
* Converts non-eccentric <ellipse>s to <circle>s.
*
* @see http://www.w3.org/TR/SVG/shapes.html
* @see http://www.w3.org/TR/SVG11/shapes.html
*
* @param {Object} item current iteration item
* @return {Boolean} if false, item will be filtered out

View File

@ -48,7 +48,7 @@ var pathElems = require('./_collections.js').pathElems,
* trim useless delimiters and leading zeros,
* decrease accuracy of floating-point numbers.
*
* @see http://www.w3.org/TR/SVG/paths.html#PathData
* @see http://www.w3.org/TR/SVG11/paths.html#PathData
*
* @param {Object} item current iteration item
* @param {Object} params plugin params

View File

@ -18,7 +18,7 @@ var none = { value: 0 },
* It also allows further optimizations like
* combining paths with similar attributes.
*
* @see http://www.w3.org/TR/SVG/shapes.html
* @see http://www.w3.org/TR/SVG11/shapes.html
*
* @param {Object} item current iteration item
* @param {Object} params plugin params

View File

@ -35,7 +35,7 @@ var cleanupOutData = require('../lib/svgo/tools').cleanupOutData,
* convert transforms to the matrices and multiply them all into one,
* remove useless transforms.
*
* @see http://www.w3.org/TR/SVG/coords.html#TransformMatrixDefined
* @see http://www.w3.org/TR/SVG11/coords.html#TransformMatrixDefined
*
* @param {Object} item current iteration item
* @param {Object} params plugin params

View File

@ -11,7 +11,7 @@ var container = require('./_collections').elemsGroups.container;
/**
* Remove empty containers.
*
* @see http://www.w3.org/TR/SVG/intro.html#TermContainerElement
* @see http://www.w3.org/TR/SVG11/intro.html#TermContainerElement
*
* @example
* <defs/>

View File

@ -15,7 +15,7 @@ exports.params = {
/**
* Remove empty Text elements.
*
* @see http://www.w3.org/TR/SVG/text.html
* @see http://www.w3.org/TR/SVG11/text.html
*
* @example
* Remove empty text element:

View File

@ -57,7 +57,7 @@ exports.fn = function (item, params) {
// display="none"
//
// http://www.w3.org/TR/SVG/painting.html#DisplayProperty
// http://www.w3.org/TR/SVG11/painting.html#DisplayProperty
// "A value of display: none indicates that the given element
// and its children shall not be rendered directly"
if (
@ -67,7 +67,7 @@ exports.fn = function (item, params) {
// opacity="0"
//
// http://www.w3.org/TR/SVG/masking.html#ObjectAndGroupOpacityProperties
// http://www.w3.org/TR/SVG11/masking.html#ObjectAndGroupOpacityProperties
if (
params.opacity0 &&
item.hasAttr('opacity', '0')
@ -75,7 +75,7 @@ exports.fn = function (item, params) {
// Circles with zero radius
//
// http://www.w3.org/TR/SVG/shapes.html#CircleElementRAttribute
// http://www.w3.org/TR/SVG11/shapes.html#CircleElementRAttribute
// "A value of zero disables rendering of the element"
//
// <circle r="0">
@ -88,7 +88,7 @@ exports.fn = function (item, params) {
// Ellipse with zero x-axis radius
//
// http://www.w3.org/TR/SVG/shapes.html#EllipseElementRXAttribute
// http://www.w3.org/TR/SVG11/shapes.html#EllipseElementRXAttribute
// "A value of zero disables rendering of the element"
//
// <ellipse rx="0">
@ -101,7 +101,7 @@ exports.fn = function (item, params) {
// Ellipse with zero y-axis radius
//
// http://www.w3.org/TR/SVG/shapes.html#EllipseElementRYAttribute
// http://www.w3.org/TR/SVG11/shapes.html#EllipseElementRYAttribute
// "A value of zero disables rendering of the element"
//
// <ellipse ry="0">
@ -114,7 +114,7 @@ exports.fn = function (item, params) {
// Rectangle with zero width
//
// http://www.w3.org/TR/SVG/shapes.html#RectElementWidthAttribute
// http://www.w3.org/TR/SVG11/shapes.html#RectElementWidthAttribute
// "A value of zero disables rendering of the element"
//
// <rect width="0">
@ -127,7 +127,7 @@ exports.fn = function (item, params) {
// Rectangle with zero height
//
// http://www.w3.org/TR/SVG/shapes.html#RectElementHeightAttribute
// http://www.w3.org/TR/SVG11/shapes.html#RectElementHeightAttribute
// "A value of zero disables rendering of the element"
//
// <rect height="0">
@ -141,7 +141,7 @@ exports.fn = function (item, params) {
// Pattern with zero width
//
// http://www.w3.org/TR/SVG/pservers.html#PatternElementWidthAttribute
// http://www.w3.org/TR/SVG11/pservers.html#PatternElementWidthAttribute
// "A value of zero disables rendering of the element (i.e., no paint is applied)"
//
// <pattern width="0">
@ -153,7 +153,7 @@ exports.fn = function (item, params) {
// Pattern with zero height
//
// http://www.w3.org/TR/SVG/pservers.html#PatternElementHeightAttribute
// http://www.w3.org/TR/SVG11/pservers.html#PatternElementHeightAttribute
// "A value of zero disables rendering of the element (i.e., no paint is applied)"
//
// <pattern height="0">
@ -165,7 +165,7 @@ exports.fn = function (item, params) {
// Image with zero width
//
// http://www.w3.org/TR/SVG/struct.html#ImageElementWidthAttribute
// http://www.w3.org/TR/SVG11/struct.html#ImageElementWidthAttribute
// "A value of zero disables rendering of the element"
//
// <image width="0">
@ -177,7 +177,7 @@ exports.fn = function (item, params) {
// Image with zero height
//
// http://www.w3.org/TR/SVG/struct.html#ImageElementHeightAttribute
// http://www.w3.org/TR/SVG11/struct.html#ImageElementHeightAttribute
// "A value of zero disables rendering of the element"
//
// <image height="0">
@ -189,7 +189,7 @@ exports.fn = function (item, params) {
// Path with empty data
//
// http://www.w3.org/TR/SVG/paths.html#DAttribute
// http://www.w3.org/TR/SVG11/paths.html#DAttribute
//
// <path d=""/>
if (
@ -200,7 +200,7 @@ exports.fn = function (item, params) {
// Polyline with empty points
//
// http://www.w3.org/TR/SVG/shapes.html#PolylineElementPointsAttribute
// http://www.w3.org/TR/SVG11/shapes.html#PolylineElementPointsAttribute
//
// <polyline points="">
if (
@ -211,7 +211,7 @@ exports.fn = function (item, params) {
// Polygon with empty points
//
// http://www.w3.org/TR/SVG/shapes.html#PolygonElementPointsAttribute
// http://www.w3.org/TR/SVG11/shapes.html#PolygonElementPointsAttribute
//
// <polygon points="">
if (

View File

@ -9,7 +9,7 @@ exports.description = 'removes <metadata>';
/**
* Remove <metadata>.
*
* http://www.w3.org/TR/SVG/metadata.html
* http://www.w3.org/TR/SVG11/metadata.html
*
* @param {Object} item current iteration item
* @return {Boolean} if false, item will be filtered out

View File

@ -9,7 +9,7 @@ exports.description = 'removes <script> elements (disabled by default)';
/**
* Remove <script>.
*
* https://www.w3.org/TR/SVG/script.html
* https://www.w3.org/TR/SVG11/script.html
*
* @param {Object} item current iteration item
* @return {Boolean} if false, item will be filtered out

View File

@ -9,7 +9,7 @@ exports.description = 'removes <style> element (disabled by default)';
/**
* Remove <style>.
*
* http://www.w3.org/TR/SVG/styling.html#StyleElement
* http://www.w3.org/TR/SVG11/styling.html#StyleElement
*
* @param {Object} item current iteration item
* @return {Boolean} if false, item will be filtered out

View File

@ -11,7 +11,7 @@ var viewBoxElems = ['svg', 'pattern', 'symbol'];
/**
* Remove viewBox attr which coincides with a width/height box.
*
* @see http://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute
* @see http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute
*
* @example
* <svg width="100" height="50" viewBox="0 0 100 50">