posthtml-rename-id
Advanced tools
Comparing version 1.0.3 to 1.1.0-alpha.10475b37
20
index.js
@@ -80,7 +80,5 @@ /* eslint-disable no-cond-assign, default-case */ | ||
let idObj; | ||
switch (attrName) { | ||
case 'href': | ||
case 'xlink:href': | ||
case 'xlink:href': { | ||
if (value.substring(0, 1) !== '#') { | ||
@@ -91,3 +89,3 @@ break; | ||
id = value.substring(1); | ||
idObj = mappedIds[id]; | ||
const idObj = mappedIds[id]; | ||
if (idObj) { | ||
@@ -98,15 +96,3 @@ idObj.referenced = false; | ||
break; | ||
case 'for': | ||
if (node.tag !== 'label') { | ||
break; | ||
} | ||
id = value; | ||
idObj = mappedIds[id]; | ||
if (idObj) { | ||
idObj.referenced = false; | ||
attrs[attrName] = idObj.id; | ||
} | ||
break; | ||
} | ||
} | ||
@@ -113,0 +99,0 @@ }); |
{ | ||
"name": "posthtml-rename-id", | ||
"version": "1.0.3", | ||
"description": "PostHTML plugin to rename id attribute and it's references", | ||
"main": "index.js", | ||
"version": "1.1.0-alpha.10475b37", | ||
"description": "PostHTML plugin to rename id attributes and it's references", | ||
"license": "MIT", | ||
"repository": "https://github.com/kisenka/svg-baker/packages/posthtml-rename-id", | ||
"files": [ | ||
"README.md", | ||
"index.js" | ||
], | ||
"author": "kisenka", | ||
"license": "MIT", | ||
"repository": "kisenka/posthtml-rename-id", | ||
"bugs": "https://github.com/kisenka/posthtml-rename-id/issues", | ||
"homepage": "https://github.com/kisenka/posthtml-rename-id#readme", | ||
"dependencies": { | ||
"escape-string-regexp": "^1.0.5" | ||
"escape-string-regexp": "1.0.5" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^4.0.1", | ||
"postsvg": "^2.0.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "mocha -r $MOCHA_SETUP_PATH" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# PostHTML rename id plugin | ||
# PostHTML rename plugin | ||
@@ -31,3 +31,4 @@ Plugin to rename id attributes and it's references. | ||
}); | ||
// => <div id="prefix_qwe"></div> <a href="#prefix_qwe"></a> | ||
// <div id="prefix_qwe"></div> <a href="#prefix_qwe"></a> | ||
``` | ||
@@ -34,0 +35,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
4963
0
4
57
0
87
2
2
Updatedescape-string-regexp@1.0.5