diff --git a/.svglintrc.js b/.svglintrc.js index 6d5651447..e3cca01e3 100644 --- a/.svglintrc.js +++ b/.svglintrc.js @@ -485,7 +485,7 @@ module.exports = { function(reporter, $, ast) { reporter.name = "extraneous"; - if (!svgRegexp.test($.html())) { + if (!svgRegexp.test(ast.source)) { reporter.error("Unexpected character(s), most likely extraneous whitespace, detected in SVG markup"); } }, @@ -569,6 +569,16 @@ module.exports = { reporter.error(`${errorMsg}: ${reason}`); } } + }, + function(reporter, $, ast) { + reporter.name = 'svg-format'; + + // Don't allow explicit '' closing tag + if (ast.source.includes('')) { + const reason = `found a closing "path" tag at index ${ast.source.indexOf('')}.` + + ' The path should be self-closing, use \'/>\' instead of \'>\'.'; + reporter.error(`Invalid SVG content format: ${reason}`); + } } ] } diff --git a/icons/autoprefixer.svg b/icons/autoprefixer.svg index d8fe367a5..b88cb1755 100644 --- a/icons/autoprefixer.svg +++ b/icons/autoprefixer.svg @@ -1 +1 @@ -Autoprefixer \ No newline at end of file +Autoprefixer \ No newline at end of file diff --git a/icons/cytoscapedotjs.svg b/icons/cytoscapedotjs.svg index b71c7701d..fa4b8c903 100644 --- a/icons/cytoscapedotjs.svg +++ b/icons/cytoscapedotjs.svg @@ -1 +1 @@ -Cytoscape.js +Cytoscape.js \ No newline at end of file diff --git a/icons/equinixmetal.svg b/icons/equinixmetal.svg index 0a1e5fa5f..0dc9b6bd2 100644 --- a/icons/equinixmetal.svg +++ b/icons/equinixmetal.svg @@ -1 +1 @@ -Equinix Metal \ No newline at end of file +Equinix Metal \ No newline at end of file diff --git a/icons/semaphoreci.svg b/icons/semaphoreci.svg index fe6ed9e40..a5daf1cbd 100644 --- a/icons/semaphoreci.svg +++ b/icons/semaphoreci.svg @@ -1 +1 @@ -Semaphore CI \ No newline at end of file +Semaphore CI \ No newline at end of file