zephyr_mirror: Zev's proposed fix to latest linewrapping problem.
(imported from commit 90fc4774e10255d0237a37b8af753059a66efb2d)
This commit is contained in:
		
							parent
							
								
									ff85226fee
								
							
						
					
					
						commit
						45057fbf5d
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -58,9 +58,12 @@ def unwrap_lines(body):
 | 
				
			||||||
    previous_line = lines[0]
 | 
					    previous_line = lines[0]
 | 
				
			||||||
    for line in lines[1:]:
 | 
					    for line in lines[1:]:
 | 
				
			||||||
        line = line.rstrip()
 | 
					        line = line.rstrip()
 | 
				
			||||||
        if (line == "" or
 | 
					        if (re.match(r'^\W', line, flags=re.UNICODE)
 | 
				
			||||||
 | 
					            and re.match(r'^\W', previous_line, flags=re.UNICODE)):
 | 
				
			||||||
 | 
					            result += previous_line + "\n"
 | 
				
			||||||
 | 
					        elif (line == "" or
 | 
				
			||||||
            previous_line == "" or
 | 
					            previous_line == "" or
 | 
				
			||||||
            not re.match(r'^[\w]', line, flags=re.UNICODE) or
 | 
					            re.match(r'^\W', line, flags=re.UNICODE) or
 | 
				
			||||||
            different_paragraph(previous_line, line)):
 | 
					            different_paragraph(previous_line, line)):
 | 
				
			||||||
            # Use 2 newlines to separate sections so that we
 | 
					            # Use 2 newlines to separate sections so that we
 | 
				
			||||||
            # trigger proper Markdown processing on things like
 | 
					            # trigger proper Markdown processing on things like
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue