mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 02:25:28 +08:00 
			
		
		
		
	modified tokenizer to not break on on ]]] at the end of a style
This commit is contained in:
		
				
					committed by
					
						
						Patrik Svensson
					
				
			
			
				
	
			
			
			
						parent
						
							4258cbfb85
						
					
				
				
					commit
					f895bb175d
				
			@@ -154,5 +154,25 @@ public partial class AnsiConsoleTests
 | 
			
		||||
            // Then
 | 
			
		||||
            console.Output.ShouldBe("[grey][white]");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        [Theory]
 | 
			
		||||
        [InlineData("[white][[[/][white]]][/]", "[]")]
 | 
			
		||||
        [InlineData("[white][[[/]", "[")]
 | 
			
		||||
        [InlineData("[white]]][/]", "]")]
 | 
			
		||||
        [InlineData("[black on white link=https://www.gooole.com/q=]]]Search for a bracket[/]", "Search for a bracket")]
 | 
			
		||||
        [InlineData("[link=https://www.gooole.com/q=]] black on white]Search for a bracket[/]", "Search for a bracket")]
 | 
			
		||||
        [InlineData("[link]https://www.gooole.com/q=]][/]", "https://www.gooole.com/q=]")]
 | 
			
		||||
        public void Should_Not_Fail_As_In_GH1024(string markup, string expected)
 | 
			
		||||
        {
 | 
			
		||||
            // Given
 | 
			
		||||
            var console = new TestConsole();
 | 
			
		||||
            console.EmitAnsiSequences = false;
 | 
			
		||||
 | 
			
		||||
            // When
 | 
			
		||||
            console.Markup(markup);
 | 
			
		||||
 | 
			
		||||
            // Then
 | 
			
		||||
            console.Output.ShouldBe(expected);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user