File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1818    from  sphinx .util .typing  import  ExtensionMetadata 
1919
2020
21+ BLURB_HEADER  =  """\  
22+ 
23+ Python News 
24+ +++++++++++ 
25+ """ 
26+ 
2127bpo_issue_re : Final [re .Pattern [str ]] =  re .compile (
2228    "(?:issue #|bpo-)([0-9]+)" , re .ASCII 
2329)
@@ -47,14 +53,15 @@ def run(self) -> list[Node]:
4753            text  =  sphinx_gettext ("The NEWS file is not available." )
4854            return  [nodes .strong (text , text )]
4955
56+         # remove first 3 lines as they are the main heading 
57+         news_text  =  news_text .removeprefix (BLURB_HEADER )
58+ 
5059        news_text  =  bpo_issue_re .sub (r":issue:`\1`" , news_text )
5160        # Fallback handling for GitHub issues 
5261        news_text  =  gh_issue_re .sub (r":gh:`\1`" , news_text )
5362        news_text  =  whatsnew_re .sub (r"\1" , news_text )
5463
55-         # remove first 3 lines as they are the main heading 
56-         lines  =  [".. default-role:: py:obj" , "" ] +  news_text .splitlines ()[3 :]
57-         self .state_machine .insert_input (lines , str (news_file ))
64+         self .state_machine .insert_input (news_text .splitlines (), str (news_file ))
5865        return  []
5966
6067
Original file line number Diff line number Diff line change 11.. _changelog :
22
3+ .. default-role :: py:obj 
4+ 
35+++++++++ 
46Changelog
57+++++++++ 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments