reffy 11.3.0 → 11.3.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": "11.3.0",
3
+ "version": "11.3.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,20 +35,20 @@
35
35
  "abortcontroller-polyfill": "1.7.5",
36
36
  "ajv": "8.12.0",
37
37
  "ajv-formats": "2.1.1",
38
- "commander": "9.5.0",
38
+ "commander": "10.0.0",
39
39
  "fetch-filecache-for-crawling": "4.1.0",
40
- "puppeteer": "19.5.0",
40
+ "puppeteer": "19.5.2",
41
41
  "semver": "^7.3.5",
42
- "web-specs": "2.41.0",
42
+ "web-specs": "2.43.0",
43
43
  "webidl2": "24.2.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "chai": "4.3.7",
47
47
  "mocha": "10.2.0",
48
- "nock": "13.2.9",
48
+ "nock": "13.3.0",
49
49
  "respec": "32.6.1",
50
50
  "respec-hljs": "2.1.1",
51
- "rollup": "3.9.1"
51
+ "rollup": "3.10.0"
52
52
  },
53
53
  "scripts": {
54
54
  "test": "mocha --recursive tests/"
@@ -216,12 +216,12 @@ function definitionMapper(el, idToHeading, usesDfnDataModel) {
216
216
  export default function (spec, idToHeading = {}) {
217
217
  const definitionsSelector = [
218
218
  // re data-lt, see https://github.com/w3c/reffy/issues/336#issuecomment-650339747
219
+ // As for `<dfn>` we'll consider that headings without a `data-dfn-type`
220
+ // have an implicit `"data-dfn-type"="dfn"` attribute, provided they also
221
+ // have some other definition related attribute (because we only want to
222
+ // extract headings that want to be seen as definitions)
219
223
  'dfn[id]:not([data-lt=""])',
220
- 'h2[id][data-dfn-type]:not([data-lt=""])',
221
- 'h3[id][data-dfn-type]:not([data-lt=""])',
222
- 'h4[id][data-dfn-type]:not([data-lt=""])',
223
- 'h5[id][data-dfn-type]:not([data-lt=""])',
224
- 'h6[id][data-dfn-type]:not([data-lt=""])'
224
+ ':is(h2,h3,h4,h5,h6)[id]:is([data-dfn-type],[data-dfn-for],[data-export],[data-noexport],[data-lt]):not([data-lt=""])'
225
225
  ].join(',');
226
226
 
227
227
  const shortname = (typeof spec === 'string') ? spec : spec.shortname;
@@ -607,13 +607,7 @@ function preProcessEcmascript() {
607
607
  }
608
608
 
609
609
  function preProcessHTML() {
610
- const headingSelector = [
611
- 'h2[id]:not([data-dfn-type]) dfn',
612
- 'h3[id]:not([data-dfn-type]) dfn',
613
- 'h4[id]:not([data-dfn-type]) dfn',
614
- 'h5[id]:not([data-dfn-type]) dfn',
615
- 'h6[id]:not([data-dfn-type]) dfn'
616
- ].join(',');
610
+ const headingSelector = ':is(h2,h3,h4,h5,h6)[id]:not(:is([data-dfn-type],[data-dfn-for],[data-export],[data-noexport],[data-lt])) dfn';
617
611
 
618
612
  // we copy the id on the dfn when it is set on the surrounding heading
619
613
  document.querySelectorAll(headingSelector)