diff --git a/src/browserlib/extract-cssdfn.mjs b/src/browserlib/extract-cssdfn.mjs index 442f4580..694d12d4 100644 --- a/src/browserlib/extract-cssdfn.mjs +++ b/src/browserlib/extract-cssdfn.mjs @@ -666,6 +666,10 @@ const extractTypedDfn = dfn => { c.remove(); } }); + [...dd.querySelectorAll('sup')] + .map(sup => sup.parentNode.removeChild(sup)); + [...dd.querySelectorAll('aside, .mdn-anno')] + .map(annotation => annotation.parentNode.removeChild(annotation)); res = { name: getDfnName(dfn), diff --git a/tests/extract-css.js b/tests/extract-css.js index 3fda8d54..8abd8592 100644 --- a/tests/extract-css.js +++ b/tests/extract-css.js @@ -1420,6 +1420,43 @@ that spans multiple lines */ value: ' | implicit' } ] + }, + + { + title: 'ignores aside info panel in p prose', + html: `

+ The <position> + determines the gradient center of the + gradient. +

+ + `, + propertyName: 'values', + css: [{ + name: '', + type: 'type', + prose: 'The determines the gradient center of the gradient.' + }] + }, + + { + title: 'ignores aside info panel in dd prose', + html: `
+
<position>
+
+ Determines the gradient center + of the gradient. +
+ + `, + propertyName: 'values', + css: [{ + name: '', + type: 'type', + prose: 'Determines the gradient center of the gradient.' + }] } ]; @@ -1453,6 +1490,15 @@ describe("Test CSS properties extraction", function() { const extractedCss = await page.evaluate(async () => { try { + // Copy