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

Remove printing

roundabout,
created on Monday, 22 April 2024, 18:50:13 (1713811813), received on Tuesday, 23 April 2024, 11:54:33 (1713873273)
Author identity: vlad <vlad.muntoiu@gmail.com>

c19d733489b9246159752135ed33575c58208193

ampoule_ssg/markdown.py

@@ -345,7 +345,6 @@ def tokenise(source):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                        while i < len(lines) and re.match(r"^ ?\d+\.", lines[i]) and len(lines[i].split(".", 1)) > 1:
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            inner_content = lines[i].split(".", 1)[1] + "\n"      # discard number and period
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            i += 1
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                                        print(lines[i])
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            marker_length = len(lines[i].split(".", 1)[0]) + 1
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                            while i < len(lines) and lines[i].strip() and not re.match(r"^ ?\d+\.", lines[i]):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                                if re.match(r"^  \d+\.", lines[i]):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        

@@ -458,6 +457,5 @@ def make_html(ast):

                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                            def markdown2html(markdown):
                                        
                                        
                                            
                                            
                                            
                                            
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            print(tokenise(markdown))
                                        
                                        
                                        
                                    
                                
                                
                                
                            
                                
                                    
                                        
                                            
                                                return make_html(tokenise(markdown))