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:
@ -75,7 +75,7 @@ exports.path2js = function(path) {
|
|||||||
|
|
||||||
data = data.map(Number);
|
data = data.map(Number);
|
||||||
// Subsequent moveto pairs of coordinates are threated as implicit lineto commands
|
// 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') {
|
if (instruction == 'M' || instruction == 'm') {
|
||||||
pathData.push({
|
pathData.push({
|
||||||
instruction: pathData.length == 0 ? 'M' : instruction,
|
instruction: pathData.length == 0 ? 'M' : instruction,
|
||||||
|
@ -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.
|
* 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
|
* @example
|
||||||
* <svg width="100" height="50" enable-background="new 0 0 100 50">
|
* <svg width="100" height="50" enable-background="new 0 0 100 50">
|
||||||
|
@ -24,8 +24,8 @@ var collections = require('./_collections'),
|
|||||||
/**
|
/**
|
||||||
* Convert different colors formats in element attributes to hex.
|
* 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/SVG11/types.html#DataTypeColor
|
||||||
* @see http://www.w3.org/TR/SVG/single-page.html#types-ColorKeywords
|
* @see http://www.w3.org/TR/SVG11/single-page.html#types-ColorKeywords
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* Convert color name keyword to long hex:
|
* Convert color name keyword to long hex:
|
||||||
|
@ -9,7 +9,7 @@ exports.description = 'converts non-eccentric <ellipse>s to <circle>s';
|
|||||||
/**
|
/**
|
||||||
* 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
|
* @param {Object} item current iteration item
|
||||||
* @return {Boolean} if false, item will be filtered out
|
* @return {Boolean} if false, item will be filtered out
|
||||||
|
@ -48,7 +48,7 @@ var pathElems = require('./_collections.js').pathElems,
|
|||||||
* trim useless delimiters and leading zeros,
|
* trim useless delimiters and leading zeros,
|
||||||
* decrease accuracy of floating-point numbers.
|
* 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} item current iteration item
|
||||||
* @param {Object} params plugin params
|
* @param {Object} params plugin params
|
||||||
|
@ -18,7 +18,7 @@ var none = { value: 0 },
|
|||||||
* It also allows further optimizations like
|
* It also allows further optimizations like
|
||||||
* combining paths with similar attributes.
|
* 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} item current iteration item
|
||||||
* @param {Object} params plugin params
|
* @param {Object} params plugin params
|
||||||
|
@ -35,7 +35,7 @@ var cleanupOutData = require('../lib/svgo/tools').cleanupOutData,
|
|||||||
* convert transforms to the matrices and multiply them all into one,
|
* convert transforms to the matrices and multiply them all into one,
|
||||||
* remove useless transforms.
|
* 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} item current iteration item
|
||||||
* @param {Object} params plugin params
|
* @param {Object} params plugin params
|
||||||
|
@ -11,7 +11,7 @@ var container = require('./_collections').elemsGroups.container;
|
|||||||
/**
|
/**
|
||||||
* Remove empty containers.
|
* Remove empty containers.
|
||||||
*
|
*
|
||||||
* @see http://www.w3.org/TR/SVG/intro.html#TermContainerElement
|
* @see http://www.w3.org/TR/SVG11/intro.html#TermContainerElement
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* <defs/>
|
* <defs/>
|
||||||
|
@ -15,7 +15,7 @@ exports.params = {
|
|||||||
/**
|
/**
|
||||||
* Remove empty Text elements.
|
* Remove empty Text elements.
|
||||||
*
|
*
|
||||||
* @see http://www.w3.org/TR/SVG/text.html
|
* @see http://www.w3.org/TR/SVG11/text.html
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* Remove empty text element:
|
* Remove empty text element:
|
||||||
|
@ -57,7 +57,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// display="none"
|
// 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
|
// "A value of display: none indicates that the given element
|
||||||
// and its children shall not be rendered directly"
|
// and its children shall not be rendered directly"
|
||||||
if (
|
if (
|
||||||
@ -67,7 +67,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// opacity="0"
|
// opacity="0"
|
||||||
//
|
//
|
||||||
// http://www.w3.org/TR/SVG/masking.html#ObjectAndGroupOpacityProperties
|
// http://www.w3.org/TR/SVG11/masking.html#ObjectAndGroupOpacityProperties
|
||||||
if (
|
if (
|
||||||
params.opacity0 &&
|
params.opacity0 &&
|
||||||
item.hasAttr('opacity', '0')
|
item.hasAttr('opacity', '0')
|
||||||
@ -75,7 +75,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Circles with zero radius
|
// 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"
|
// "A value of zero disables rendering of the element"
|
||||||
//
|
//
|
||||||
// <circle r="0">
|
// <circle r="0">
|
||||||
@ -88,7 +88,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Ellipse with zero x-axis radius
|
// 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"
|
// "A value of zero disables rendering of the element"
|
||||||
//
|
//
|
||||||
// <ellipse rx="0">
|
// <ellipse rx="0">
|
||||||
@ -101,7 +101,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Ellipse with zero y-axis radius
|
// 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"
|
// "A value of zero disables rendering of the element"
|
||||||
//
|
//
|
||||||
// <ellipse ry="0">
|
// <ellipse ry="0">
|
||||||
@ -114,7 +114,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Rectangle with zero width
|
// 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"
|
// "A value of zero disables rendering of the element"
|
||||||
//
|
//
|
||||||
// <rect width="0">
|
// <rect width="0">
|
||||||
@ -127,7 +127,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Rectangle with zero height
|
// 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"
|
// "A value of zero disables rendering of the element"
|
||||||
//
|
//
|
||||||
// <rect height="0">
|
// <rect height="0">
|
||||||
@ -141,7 +141,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Pattern with zero width
|
// 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)"
|
// "A value of zero disables rendering of the element (i.e., no paint is applied)"
|
||||||
//
|
//
|
||||||
// <pattern width="0">
|
// <pattern width="0">
|
||||||
@ -153,7 +153,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Pattern with zero height
|
// 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)"
|
// "A value of zero disables rendering of the element (i.e., no paint is applied)"
|
||||||
//
|
//
|
||||||
// <pattern height="0">
|
// <pattern height="0">
|
||||||
@ -165,7 +165,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Image with zero width
|
// 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"
|
// "A value of zero disables rendering of the element"
|
||||||
//
|
//
|
||||||
// <image width="0">
|
// <image width="0">
|
||||||
@ -177,7 +177,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Image with zero height
|
// 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"
|
// "A value of zero disables rendering of the element"
|
||||||
//
|
//
|
||||||
// <image height="0">
|
// <image height="0">
|
||||||
@ -189,7 +189,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Path with empty data
|
// Path with empty data
|
||||||
//
|
//
|
||||||
// http://www.w3.org/TR/SVG/paths.html#DAttribute
|
// http://www.w3.org/TR/SVG11/paths.html#DAttribute
|
||||||
//
|
//
|
||||||
// <path d=""/>
|
// <path d=""/>
|
||||||
if (
|
if (
|
||||||
@ -200,7 +200,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Polyline with empty points
|
// Polyline with empty points
|
||||||
//
|
//
|
||||||
// http://www.w3.org/TR/SVG/shapes.html#PolylineElementPointsAttribute
|
// http://www.w3.org/TR/SVG11/shapes.html#PolylineElementPointsAttribute
|
||||||
//
|
//
|
||||||
// <polyline points="">
|
// <polyline points="">
|
||||||
if (
|
if (
|
||||||
@ -211,7 +211,7 @@ exports.fn = function (item, params) {
|
|||||||
|
|
||||||
// Polygon with empty points
|
// Polygon with empty points
|
||||||
//
|
//
|
||||||
// http://www.w3.org/TR/SVG/shapes.html#PolygonElementPointsAttribute
|
// http://www.w3.org/TR/SVG11/shapes.html#PolygonElementPointsAttribute
|
||||||
//
|
//
|
||||||
// <polygon points="">
|
// <polygon points="">
|
||||||
if (
|
if (
|
||||||
|
@ -9,7 +9,7 @@ exports.description = 'removes <metadata>';
|
|||||||
/**
|
/**
|
||||||
* Remove <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
|
* @param {Object} item current iteration item
|
||||||
* @return {Boolean} if false, item will be filtered out
|
* @return {Boolean} if false, item will be filtered out
|
||||||
|
@ -9,7 +9,7 @@ exports.description = 'removes <script> elements (disabled by default)';
|
|||||||
/**
|
/**
|
||||||
* Remove <script>.
|
* Remove <script>.
|
||||||
*
|
*
|
||||||
* https://www.w3.org/TR/SVG/script.html
|
* https://www.w3.org/TR/SVG11/script.html
|
||||||
*
|
*
|
||||||
* @param {Object} item current iteration item
|
* @param {Object} item current iteration item
|
||||||
* @return {Boolean} if false, item will be filtered out
|
* @return {Boolean} if false, item will be filtered out
|
||||||
|
@ -9,7 +9,7 @@ exports.description = 'removes <style> element (disabled by default)';
|
|||||||
/**
|
/**
|
||||||
* Remove <style>.
|
* 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
|
* @param {Object} item current iteration item
|
||||||
* @return {Boolean} if false, item will be filtered out
|
* @return {Boolean} if false, item will be filtered out
|
||||||
|
@ -11,7 +11,7 @@ var viewBoxElems = ['svg', 'pattern', 'symbol'];
|
|||||||
/**
|
/**
|
||||||
* Remove viewBox attr which coincides with a width/height box.
|
* 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
|
* @example
|
||||||
* <svg width="100" height="50" viewBox="0 0 100 50">
|
* <svg width="100" height="50" viewBox="0 0 100 50">
|
||||||
|
Reference in New Issue
Block a user