testaro 12.7.2 → 12.7.3
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/package.json +1 -1
- package/tests/dupAtt.js +6 -2
package/package.json
CHANGED
package/tests/dupAtt.js
CHANGED
|
@@ -40,20 +40,24 @@ exports.reporter = async (page, withItems) => {
|
|
|
40
40
|
}
|
|
41
41
|
// Change any spacing character sequences in it to single spaces.
|
|
42
42
|
rawPage = rawPage.replace(/\s+/g, ' ');
|
|
43
|
+
// Delete any spaces adjacent to equal symbols in it.
|
|
44
|
+
rawPage = rawPage.replace(/ = | =|= /g, '=');
|
|
43
45
|
// Remove any escaped quotation marks from it.
|
|
44
46
|
rawPage = rawPage.replace(/\\"|\\'/g, '');
|
|
45
47
|
// Remove any quoted text from it.
|
|
46
|
-
rawPage = rawPage.replace(/"[
|
|
48
|
+
rawPage = rawPage.replace(/"[^"]*"|'[^']*'/g, '');
|
|
47
49
|
// Remove any script code from it.
|
|
48
50
|
rawPage = rawPage.replace(/<(script [^<>]+)>.*?<\/script>/g, '$1');
|
|
49
51
|
// Remove any comments from it.
|
|
50
52
|
rawPage = rawPage.replace(/<!--.*?-->/g, '');
|
|
53
|
+
console.log(rawPage);
|
|
51
54
|
// Extract the opening tags of its elements.
|
|
52
55
|
let elements = rawPage.match(/<[a-zA-Z][^<>]+>/g);
|
|
53
56
|
// Delete their enclosing angle brackets and the values of any attributes in them.
|
|
54
|
-
elements = elements.map(el => el.replace(/^<
|
|
57
|
+
elements = elements.map(el => el.replace(/^< *|=[^ ]*| *>$/g, ''));
|
|
55
58
|
// For each element:
|
|
56
59
|
elements.forEach(element => {
|
|
60
|
+
console.log(element);
|
|
57
61
|
// Identify its tag name and attributes.
|
|
58
62
|
const terms = element.split(' ');
|
|
59
63
|
// If it has 2 or more attributes:
|