Remove extraneous spaces from icon markup (#3256)

* Remove extraneous spaces from icon markup

* Add linting check for excess whitespace
This commit is contained in:
Peter Noble 2020-07-05 14:57:00 +01:00 committed by GitHub
parent a1c01e5545
commit 6a2e8ca4a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 10 additions and 10 deletions

View File

@ -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");
} }
}, },
] ]