testaro 14.7.0 → 14.7.1
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/standardize.js +3 -3
package/package.json
CHANGED
package/standardize.js
CHANGED
|
@@ -22,10 +22,10 @@ const cap = rawString => {
|
|
|
22
22
|
const getIdentifiers = code => {
|
|
23
23
|
let tagName = '';
|
|
24
24
|
let id = '';
|
|
25
|
-
// If the substring includes
|
|
26
|
-
if (code && typeof code === 'string' && code.length &&
|
|
25
|
+
// If the substring includes the start tag of an element:
|
|
26
|
+
if (code && typeof code === 'string' && code.length && /<\s*[a-zA-Z]/.test(code)) {
|
|
27
27
|
// Get the first start tag in the substring.
|
|
28
|
-
const startTag = code.replace(/^.*?<(
|
|
28
|
+
const startTag = code.replace(/^.*?<(?=[a-zA-Z])/s, '').replace(/>.*$/s, '').trim();
|
|
29
29
|
// If it exists:
|
|
30
30
|
if (startTag && startTag.length) {
|
|
31
31
|
// Get its tag name, upper-cased.
|