File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1515issues  =  list (repo .get_issues (state = "open" , labels = ["ambassador" ]))
1616print (f"✅ Found { len (issues )}   issues" )
1717
18- # Define helper  function to extract field content by label  
18+ # Updated extract  function that handles markdown code blocks  
1919def  extract (label , body ):
20-     pattern  =  rf"{ re .escape (label )}  \s*\n+(.+?)(\n\S|\Z)" 
21-     match  =  re .search (pattern , body , re .DOTALL )
22-     return  match .group (1 ).strip () if  match  else  "" 
20+     # Try to extract content inside markdown code block first 
21+     pattern_md  =  rf"{ re .escape (label )}  \s*\n+```(?:markdown)?\n(.*?)\n```" 
22+     match_md  =  re .search (pattern_md , body , re .DOTALL )
23+ 
24+     if  match_md :
25+         return  match_md .group (1 ).strip ()
26+ 
27+     # Fallback to plain text if no code block is found 
28+     pattern_txt  =  rf"{ re .escape (label )}  \s*\n+(.+?)(\n\S|\Z)" 
29+     match_txt  =  re .search (pattern_txt , body , re .DOTALL )
30+ 
31+     return  match_txt .group (1 ).strip () if  match_txt  else  "" 
2332
2433# Create output list 
2534output_rows  =  []
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments