reffy 12.1.0 → 12.1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reffy",
3
- "version": "12.1.0",
3
+ "version": "12.1.1",
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",
@@ -698,16 +698,27 @@ function preProcessCSS21() {
698
698
  // Complete the "<dfn>" with expected attributes
699
699
  dfn.id = anchor.getAttribute('name');
700
700
  dfn.dataset.export = '';
701
- if (span.getAttribute('title')) {
702
- dfn.dataset.lt = span.getAttribute('title');
703
- }
701
+ // Drop suffixes such "::definition of" and wrapping quotes,
702
+ // and drop possible duplicates
703
+ dfn.dataset.lt = (span.getAttribute('title') ?? dfn.textContent).split('|')
704
+ .map(normalize)
705
+ .map(text => text.replace(/::definition of$/, '')
706
+ .replace(/, definition of$/, '')
707
+ .replace(/^'(.*)'$/, '$1'))
708
+ .filter((text, idx, array) => array.indexOf(text) === idx)
709
+ .join('|');
704
710
  let dfnType = null;
705
711
  switch (anchor.getAttribute('class') ?? '') {
706
712
  case 'propdef-title':
707
713
  dfnType = 'property';
708
714
  break;
709
715
  case 'value-def':
710
- dfnType = 'value';
716
+ if (dfn.dataset.lt.match(/^<.*>$/)) {
717
+ dfnType = 'type';
718
+ }
719
+ else {
720
+ dfnType = 'value';
721
+ }
711
722
  break;
712
723
  }
713
724
  if (dfnType) {