mirror of
https://github.com/Mibew/simple-icons.git
synced 2025-05-03 01:26:43 +03:00
Remove extraneous spaces from icon markup (#3256)
* Remove extraneous spaces from icon markup * Add linting check for excess whitespace
This commit is contained in:
parent
a1c01e5545
commit
6a2e8ca4a3
@ -3,7 +3,7 @@ const { htmlFriendlyToTitle } = require("./scripts/utils.js");
|
|||||||
const getBounds = require("svg-path-bounding-box");
|
const getBounds = require("svg-path-bounding-box");
|
||||||
|
|
||||||
const titleRegexp = /(.+) icon$/;
|
const titleRegexp = /(.+) icon$/;
|
||||||
const svgRegexp = /^<svg.*<\/svg>\r?\n?$/;
|
const svgRegexp = /^<svg( [^\s]*=".*"){3}><title>.*<\/title><path d=".*"\/><\/svg>\r?\n?$/;
|
||||||
|
|
||||||
const iconSize = 24;
|
const iconSize = 24;
|
||||||
const iconFloatPrecision = 3;
|
const iconFloatPrecision = 3;
|
||||||
@ -77,7 +77,7 @@ module.exports = {
|
|||||||
|
|
||||||
const rawSVG = $.html();
|
const rawSVG = $.html();
|
||||||
if (!svgRegexp.test(rawSVG)) {
|
if (!svgRegexp.test(rawSVG)) {
|
||||||
reporter.error("Unexpected character(s) detected outside the opening and/or closing <svg> tags");
|
reporter.error("Unexpected character(s), most likely extraneous whitespace, detected in SVG markup");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user