Skip to content

Commit

Permalink
chore(htmlcs): fix table regx filter
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed May 16, 2023
1 parent a31cf81 commit 21c0a7a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions fast_htmlcs/HTMLCS.Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1185,13 +1185,12 @@ _global.HTMLCS.util = {
const filteredExp = exp
.sort()
.filter(function (value, index) {
return this.indexOf(value) === index;
return value.indexOf(index);
});

cells.push({
cell: thisCell,
headers: ` ${filteredExp.join(" ")} `
// @ts-ignore
.replace(/\s+/g, " ")
.replace(/(\w+\s)\1+/g, "$1")
.replace(/^\s*(.*?)\s*$/g, "$1"),
Expand Down
2 changes: 1 addition & 1 deletion fast_htmlcs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fast_htmlcs",
"version": "0.0.29",
"version": "0.0.30",
"description": "A high performance fork of HTML_CodeSniffer.",
"license": "BSD-3-Clause",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion kayle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kayle",
"version": "0.4.22",
"version": "0.4.23",
"description": "Extremely fast accessibility evaluation for nodejs",
"main": "./build/index.js",
"keywords": [
Expand Down
6 changes: 2 additions & 4 deletions kayle/tests/basic-htmlcs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from "assert";
import puppeteer from "puppeteer";
import { kayle, setNetworkInterception } from "kayle";
import { kayle } from "kayle";
import { drakeMock } from "./mocks/html-mock";
import { performance } from "perf_hooks";

Expand All @@ -9,16 +9,14 @@ import { performance } from "perf_hooks";
const page = await browser.newPage();
page.on("console", (msg) => console.log("PAGE LOG:", msg.text()));

await setNetworkInterception(page);
await page.setContent(drakeMock);

const startTime = performance.now();
const { issues, pageUrl, documentTitle, meta, automateable } = await kayle({
page,
browser,
runners: ["htmlcs"],
includeWarnings: true,
origin: "https://www.drake.com",
html: drakeMock
});
const nextTime = performance.now() - startTime;

Expand Down
3 changes: 3 additions & 0 deletions kayle/tests/mocks/html-tables-mock.ts

Large diffs are not rendered by default.

0 comments on commit 21c0a7a

Please sign in to comment.