mirror of
				https://github.com/flynx/colors.js.git
				synced 2025-10-31 03:50:11 +00:00 
			
		
		
		
	Preserve multiple consecutive newlines when applying style (closes #231)
This commit is contained in:
		
							parent
							
								
									fa147da91b
								
							
						
					
					
						commit
						7aa37ffe71
					
				| @ -125,7 +125,9 @@ function applyStyle() { | |||||||
|     var code = ansiStyles[nestedStyles[i]]; |     var code = ansiStyles[nestedStyles[i]]; | ||||||
|     str = code.open + str.replace(code.closeRe, code.open) + code.close; |     str = code.open + str.replace(code.closeRe, code.open) + code.close; | ||||||
|     if (newLinesPresent) { |     if (newLinesPresent) { | ||||||
|       str = str.replace(newLineRegex, code.close + '\n' + code.open); |       str = str.replace(newLineRegex, function(match) { | ||||||
|  |         return code.close + match + code.open; | ||||||
|  |       }); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user