reffy 16.1.1 → 16.1.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": "16.1.1",
3
+ "version": "16.1.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",
@@ -32,20 +32,20 @@
32
32
  "main": "index.js",
33
33
  "bin": "./reffy.js",
34
34
  "dependencies": {
35
- "ajv": "8.16.0",
35
+ "ajv": "8.17.1",
36
36
  "ajv-formats": "3.0.1",
37
37
  "commander": "12.1.0",
38
38
  "fetch-filecache-for-crawling": "5.1.1",
39
- "puppeteer": "22.13.0",
39
+ "puppeteer": "22.13.1",
40
40
  "semver": "^7.3.5",
41
41
  "web-specs": "3.13.1",
42
42
  "webidl2": "24.4.1"
43
43
  },
44
44
  "devDependencies": {
45
- "mocha": "10.6.0",
45
+ "mocha": "10.7.0",
46
46
  "respec": "35.1.1",
47
47
  "respec-hljs": "2.1.1",
48
- "rollup": "4.18.1",
48
+ "rollup": "4.19.0",
49
49
  "undici": "^6.1.0"
50
50
  },
51
51
  "overrides": {
@@ -404,14 +404,17 @@ function getDefinedNameIn(el) {
404
404
  */
405
405
  function findIntroParagraph(algo) {
406
406
  let paragraph;
407
- let container = algo.root.closest('.algorithm');
407
+ let container = algo.root.closest('li,.algorithm');
408
408
  while (container) {
409
409
  const dfn = container.querySelector('dfn');
410
- if (dfn) {
411
- paragraph = dfn.closest('p,div');
410
+ if (dfn && !algo.root.contains(dfn)) {
411
+ paragraph = dfn.closest('p,div,li');
412
+ break;
413
+ }
414
+ if (container.nodeName === 'LI') {
412
415
  break;
413
416
  }
414
- container = container.parentElement.closest('.algorithm');
417
+ container = container.parentElement.closest('li,.algorithm');
415
418
  }
416
419
 
417
420
  if (!paragraph) {
@@ -441,9 +444,10 @@ function getAlgorithmInfo(algo, context) {
441
444
  // Note some specs add the "algorithm" class to the `<ol>` and to the
442
445
  // wrapping container, and define the name in the wrapping container.
443
446
  let info = {};
447
+
444
448
  let container = algo.root.closest('.algorithm');
445
- while (container) {
446
- if (container && !context?.nested) {
449
+ if (!context?.nested) {
450
+ while (container) {
447
451
  if (container.getAttribute('data-algorithm')) {
448
452
  info.name = normalize(container.getAttribute('data-algorithm'));
449
453
  if (container.getAttribute('data-algorithm-for')) {
@@ -462,13 +466,15 @@ function getAlgorithmInfo(algo, context) {
462
466
  info.href = dfn.href;
463
467
  }
464
468
  }
465
- break;
466
469
  }
467
470
  else {
468
471
  info = getDefinedNameIn(container);
472
+ if (info.name || info.href) {
473
+ break;
474
+ }
469
475
  }
476
+ container = container.parentElement.closest('.algorithm');
470
477
  }
471
- container = container.parentElement.closest('.algorithm');
472
478
  }
473
479
 
474
480
  // Get the introductory prose from the previous paragraph