@@ -203,13 +203,12 @@ export const extractMetadataFromPage = async (
203203 let pageLevelDescription = '' ;
204204 const collectedParagraphs : string [ ] = [ ] ;
205205
206- // Strategy 1: Look for Salesforce's standard shortdesc div (including in shadow DOM)
206+ // Step 1: Look for Salesforce's standard shortdesc div (including in shadow DOM)
207207 const shortdescDiv = searchInShadowDOM ( document , 'div.shortdesc' ) ;
208208 collectedParagraphs . push ( shortdescDiv ?. textContent ?. trim ( ) ?? '' ) ;
209209
210- // Strategy 2: Look for direct paragraph siblings after heading OR after shortdesc
210+ // Step 2: Look for direct paragraph siblings after heading OR after shortdesc
211211 // Collect additional paragraphs until we find one with "extends" (inheritance info)
212- const mainHeading = document . querySelector ( 'h1' ) ;
213212 // Start from shortdescDiv's next sibling
214213 const startElement = shortdescDiv ?. nextElementSibling ;
215214
@@ -292,21 +291,6 @@ export const extractMetadataFromPage = async (
292291 pageLevelDescription = collectedParagraphs . join ( ' ' ) ;
293292 }
294293
295- // Strategy 3: If still not found, do a broader search for the first P after the heading
296- if ( ! pageLevelDescription && mainHeading ) {
297- const allParagraphs = Array . from ( document . querySelectorAll ( 'p, dd' ) ) ;
298- for ( const p of allParagraphs ) {
299- // Only consider paragraphs that come after the heading in DOM order and are not in callouts
300- if ( ! isInsideCallout ( p ) && mainHeading . compareDocumentPosition ( p ) & Node . DOCUMENT_POSITION_FOLLOWING ) {
301- const text = p . textContent ?. trim ( ) ?? '' ;
302- if ( isValidDescription ( text ) ) {
303- pageLevelDescription = text ;
304- break ;
305- }
306- }
307- }
308- }
309-
310294 // Find all tables (including in shadow DOMs)
311295 const allTables = collectFromShadowDOM ( document , 'table' ) ;
312296
0 commit comments