By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

Fix markdown crash

roundabout,
created on Thursday, 30 May 2024, 08:47:23 (1717058843), received on Wednesday, 31 July 2024, 06:54:49 (1722408889)
Author identity: vlad <vlad.muntoiu@gmail.com>

14d01b0cebcde8c963d346549f6c78452442fb39

markdown.py

@@ -18,7 +18,7 @@ inline_regex = r"""

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            |
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            (?:^|\s)(?P<em2>_{1,7}) (?P<textEm2>(?:\\.|[^*])*) (?P=em2)(?=\s|$)                # emphasis with _ requiring space on at least one side
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            |
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        [``] (?P<textCode>(?:\\[``]|[^``])*) [``]                                          # inline code (2 backticks)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                        [``] (?P<textCode2>(?:\\[``]|[^``])*) [``]                                          # inline code (2 backticks)
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            |
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            [`] (?P<textCode>(?:\\[`]|[^`])*) [`]                                              # inline code
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            |
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -282,6 +282,8 @@ def parse_line(source):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        tokens.append(Emphasis(i.group("textEm2"), len(i.group("em2"))))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    if i.group("textCode"):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        tokens.append(Code(i.group("textCode")))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                if i.group("textCode2")
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                    tokens.append(Code(i.group("textCode2")))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    if i.group("strike"):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        tokens.append(Strikethrough(i.group("textStrike")))
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                    if i.group("diff"):