@caweb/a11y-webpack-plugin 2.1.4 → 2.1.5

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.
Files changed (3) hide show
  1. package/index.js +5 -1
  2. package/package.json +3 -3
  3. 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
- let newName = file.replace( target.replace(':', '_') + '\\', '').replace('.html.html', '.html');
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.4",
3
+ "version": "2.1.5",
4
4
  "description": "CAWebPublishing Webpack Plugin to run Accessibility Scans",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -35,12 +35,12 @@
35
35
  "webpack"
36
36
  ],
37
37
  "dependencies": {
38
- "@caweb/webpack": "^1.6.8",
38
+ "@caweb/webpack": "^1.6.9",
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.6",
43
+ "@caweb/html-webpack-plugin": "^2.1.8",
44
44
  "webpack": "^5.105.2",
45
45
  "webpack-cli": "^6.0.1"
46
46
  }
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(/\.json$/, '').replace(/\\/g, '/');
325
+ file = file.replace(/\\/g, '/');
326
326
 
327
- return `<tr><td><a href="${file}" target="_blank">${file}</a></td><td><a href="${file}" target="_blank">${file}</a></td></tr>`
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>'