From 6a2e8ca4a3dce565a89b92ff1b12f15a9f90b5b4 Mon Sep 17 00:00:00 2001 From: Peter Noble Date: Sun, 5 Jul 2020 14:57:00 +0100 Subject: [PATCH] Remove extraneous spaces from icon markup (#3256) * Remove extraneous spaces from icon markup * Add linting check for excess whitespace --- .svglintrc.js | 4 ++-- icons/ardour.svg | 2 +- icons/celery.svg | 2 +- icons/centos.svg | 2 +- icons/cloudsmith.svg | 2 +- icons/deepin.svg | 2 +- icons/jetbrains.svg | 2 +- icons/ktm.svg | 2 +- icons/ublockorigin.svg | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.svglintrc.js b/.svglintrc.js index 6b248565..a09b3911 100644 --- a/.svglintrc.js +++ b/.svglintrc.js @@ -3,7 +3,7 @@ const { htmlFriendlyToTitle } = require("./scripts/utils.js"); const getBounds = require("svg-path-bounding-box"); const titleRegexp = /(.+) icon$/; -const svgRegexp = /^\r?\n?$/; +const svgRegexp = /^.*<\/title><path d=".*"\/><\/svg>\r?\n?$/; const iconSize = 24; const iconFloatPrecision = 3; @@ -77,7 +77,7 @@ module.exports = { const rawSVG = $.html(); 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"); } }, ] diff --git a/icons/ardour.svg b/icons/ardour.svg index d6af113d..5995b1af 100644 --- a/icons/ardour.svg +++ b/icons/ardour.svg @@ -1 +1 @@ -<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" ><title>Ardour icon \ No newline at end of file +Ardour icon \ No newline at end of file diff --git a/icons/celery.svg b/icons/celery.svg index 91e3af81..2352db42 100644 --- a/icons/celery.svg +++ b/icons/celery.svg @@ -1 +1 @@ -Celery icon \ No newline at end of file +Celery icon \ No newline at end of file diff --git a/icons/centos.svg b/icons/centos.svg index 9253069e..4d994268 100644 --- a/icons/centos.svg +++ b/icons/centos.svg @@ -1 +1 @@ -CentOS icon \ No newline at end of file +CentOS icon \ No newline at end of file diff --git a/icons/cloudsmith.svg b/icons/cloudsmith.svg index 683caade..7f23b16b 100644 --- a/icons/cloudsmith.svg +++ b/icons/cloudsmith.svg @@ -1 +1 @@ -Cloudsmith icon +Cloudsmith icon diff --git a/icons/deepin.svg b/icons/deepin.svg index eea4cf9a..9acf92a0 100644 --- a/icons/deepin.svg +++ b/icons/deepin.svg @@ -1 +1 @@ -deepin icon \ No newline at end of file +deepin icon \ No newline at end of file diff --git a/icons/jetbrains.svg b/icons/jetbrains.svg index a3bd661e..b4129955 100644 --- a/icons/jetbrains.svg +++ b/icons/jetbrains.svg @@ -1 +1 @@ -JetBrains icon +JetBrains icon diff --git a/icons/ktm.svg b/icons/ktm.svg index b2446f1c..8c461158 100644 --- a/icons/ktm.svg +++ b/icons/ktm.svg @@ -1 +1 @@ -KTM icon +KTM icon diff --git a/icons/ublockorigin.svg b/icons/ublockorigin.svg index 0cf35f73..2f4e79d4 100644 --- a/icons/ublockorigin.svg +++ b/icons/ublockorigin.svg @@ -1 +1 @@ -uBlock Origin icon \ No newline at end of file +uBlock Origin icon \ No newline at end of file