mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-01 01:25:27 +08:00 
			
		
		
		
	Escape any Markup when displaying selected prompt items
If the item contained escaped markup, after the call to RemoveMarkup the string will contain unescaped markup (that the user explicitly had escaped before) for those cases we need to escape all remaining markup.
This commit is contained in:
		 Nils Andresen
					Nils Andresen
				
			
				
					committed by
					
						 Patrik Svensson
						Patrik Svensson
					
				
			
			
				
	
			
			
			 Patrik Svensson
						Patrik Svensson
					
				
			
						parent
						
							b738187b28
						
					
				
				
					commit
					ba4b7b97f8
				
			| @@ -253,7 +253,7 @@ namespace Spectre.Console | ||||
|                 var text = (Converter ?? TypeConverterHelper.ConvertToString)?.Invoke(item.Node.Data) ?? item.Node.Data.ToString() ?? "?"; | ||||
|                 if (current) | ||||
|                 { | ||||
|                     text = text.RemoveMarkup(); | ||||
|                     text = text.RemoveMarkup().EscapeMarkup(); | ||||
|                 } | ||||
|  | ||||
|                 var checkbox = item.Node.IsSelected | ||||
|   | ||||
| @@ -167,7 +167,7 @@ namespace Spectre.Console | ||||
|                 var text = (Converter ?? TypeConverterHelper.ConvertToString)?.Invoke(item.Node.Data) ?? item.Node.Data.ToString() ?? "?"; | ||||
|                 if (current) | ||||
|                 { | ||||
|                     text = text.RemoveMarkup(); | ||||
|                     text = text.RemoveMarkup().EscapeMarkup(); | ||||
|                 } | ||||
|  | ||||
|                 grid.AddRow(new Markup(indent + prompt + " " + text, style)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user