@caweb/a11y-webpack-plugin 2.1.4 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -1
- package/package.json +4 -4
- package/reporter.js +5 -2
package/index.js
CHANGED
|
@@ -235,7 +235,11 @@ class CAWebA11yPlugin {
|
|
|
235
235
|
|
|
236
236
|
// if the fle ends with .json or .html
|
|
237
237
|
if( file.endsWith('.json') || file.endsWith('.html') ){
|
|
238
|
-
|
|
238
|
+
|
|
239
|
+
// the auditor replace : with _
|
|
240
|
+
// Mac prefix the target with a forward slash, we can remove that
|
|
241
|
+
let reg = new RegExp(`[\\\\/]*${ target.replace(':', '_').replace(/^\//, '') }[\\\\/]?` );
|
|
242
|
+
let newName = file.replace( reg, '').replace('.html.html', '.html');
|
|
239
243
|
|
|
240
244
|
// make sure the directory exists before renaming the file, if not we create it.
|
|
241
245
|
if( ! fs.existsSync( path.join(outputFolder, path.dirname(newName)) ) ){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caweb/a11y-webpack-plugin",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "CAWebPublishing Webpack Plugin to run Accessibility Scans",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"webpack"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@caweb/webpack": "^
|
|
38
|
+
"@caweb/webpack": "^2.0.0",
|
|
39
39
|
"accessibility-checker": "^4.0.12",
|
|
40
40
|
"check-valid-url": "^0.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@caweb/html-webpack-plugin": "^2.1.
|
|
44
|
-
"webpack": "^5.105.
|
|
43
|
+
"@caweb/html-webpack-plugin": "^2.1.9",
|
|
44
|
+
"webpack": "^5.105.3",
|
|
45
45
|
"webpack-cli": "^6.0.1"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/reporter.js
CHANGED
|
@@ -322,9 +322,12 @@ function landingPage(data, opts ){
|
|
|
322
322
|
...data.sort().map(file => {
|
|
323
323
|
// remove the .json extension from the file name
|
|
324
324
|
// we also replace backslashes with forward slashes for better readability
|
|
325
|
-
file = file.replace(
|
|
325
|
+
file = file.replace(/\\/g, '/');
|
|
326
326
|
|
|
327
|
-
|
|
327
|
+
// we can skip the reports.html'
|
|
328
|
+
if( 'reports.html' !== file ){
|
|
329
|
+
return `<tr><td><a href="/${file}" target="_blank">${file}</a></td><td><a href="${file}" target="_blank">${file}</a></td></tr>`
|
|
330
|
+
}
|
|
328
331
|
}),
|
|
329
332
|
'</tbody></table>',
|
|
330
333
|
'</div></div></div>'
|