reffy 19.2.0 → 19.2.2
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reffy",
|
|
3
|
-
"version": "19.2.
|
|
3
|
+
"version": "19.2.2",
|
|
4
4
|
"description": "W3C/WHATWG spec dependencies exploration companion. Features a short set of tools to study spec references as well as WebIDL term definitions and references found in W3C specifications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"ajv": "8.17.1",
|
|
37
37
|
"ajv-formats": "3.0.1",
|
|
38
|
-
"commander": "14.0.
|
|
38
|
+
"commander": "14.0.1",
|
|
39
39
|
"fetch-filecache-for-crawling": "5.1.1",
|
|
40
|
-
"puppeteer": "24.
|
|
40
|
+
"puppeteer": "24.20.0",
|
|
41
41
|
"semver": "^7.3.5",
|
|
42
|
-
"web-specs": "3.
|
|
42
|
+
"web-specs": "3.63.0",
|
|
43
43
|
"webidl2": "24.5.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"respec": "35.5.1",
|
|
47
47
|
"respec-hljs": "2.1.1",
|
|
48
|
-
"rollup": "4.50.
|
|
48
|
+
"rollup": "4.50.1",
|
|
49
49
|
"undici": "^7.0.0"
|
|
50
50
|
},
|
|
51
51
|
"overrides": {
|
|
@@ -176,22 +176,22 @@ function extractReferencesWithoutRules() {
|
|
|
176
176
|
const refs = [];
|
|
177
177
|
clause.querySelectorAll('p').forEach(p => {
|
|
178
178
|
const ref = {};
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
if (!match) {
|
|
184
|
-
ref.name = p.querySelector('i')?.innerText.trim();
|
|
185
|
-
}
|
|
186
|
-
if (!ref.name) {
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
|
|
179
|
+
const nameMatch = p.innerText.match(/(.+?)(,|\.)/m);
|
|
180
|
+
const name = nameMatch ? nameMatch[1].trim() : null;
|
|
181
|
+
const hasFullTitle = !!p.querySelector('i');
|
|
190
182
|
const anchor = p.querySelector('a[href]');
|
|
191
|
-
if (anchor) {
|
|
192
|
-
ref.
|
|
183
|
+
if (name && (anchor || hasFullTitle)) {
|
|
184
|
+
ref.name = name;
|
|
185
|
+
}
|
|
186
|
+
if (ref.name) {
|
|
187
|
+
if (anchor) {
|
|
188
|
+
const url = anchor.getAttribute('href');
|
|
189
|
+
if (url.match(/^https?:\/\//)) {
|
|
190
|
+
ref.url = url;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
refs.push(ref);
|
|
193
194
|
}
|
|
194
|
-
refs.push(ref);
|
|
195
195
|
});
|
|
196
196
|
references[refType] = refs;
|
|
197
197
|
}
|