Skip to content

Commit

Permalink
Fix svg spec urls in plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Feb 24, 2021
1 parent 355fb1f commit 9263d9a
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion plugins/_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion plugins/cleanupEnableBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
4 changes: 2 additions & 2 deletions plugins/convertColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertEllipseToCircle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertPathData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertShapeToPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/removeEmptyContainers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/>
Expand Down
2 changes: 1 addition & 1 deletion plugins/removeEmptyText.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 14 additions & 14 deletions plugins/removeHiddenElems.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -67,15 +67,15 @@ 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')
) return false;

// 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">
Expand All @@ -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">
Expand All @@ -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">
Expand All @@ -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">
Expand All @@ -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">
Expand All @@ -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">
Expand All @@ -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">
Expand All @@ -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">
Expand All @@ -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">
Expand All @@ -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 (
Expand All @@ -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 (
Expand All @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion plugins/removeMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/removeScriptElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/removeStyleElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/removeViewBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 9263d9a

Please sign in to comment.