Browse Source
Merge pull request #1315 from AvaloniaUI/fixes/1275-trim-whitespace
Correctly trim whitespace in XAML elements. Fix #1275.
pull/1316/head
Jeremy Koritzinsky
9 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
20 additions and
1 deletions
-
src/Markup/Avalonia.Markup.Xaml/PortableXaml/portable.xaml.github
-
tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
|
|
|
@ -1 +1 @@ |
|
|
|
Subproject commit d50ae8335eb50d4b9606de6f5fa1cbbc78bfd72f |
|
|
|
Subproject commit c0664014455392ac221a765e66f9837704339b6f |
|
|
|
@ -868,6 +868,25 @@ do we need it?")] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Element_Whitespace_Should_Be_Trimmed() |
|
|
|
{ |
|
|
|
using (UnitTestApplication.Start(TestServices.MockWindowingPlatform)) |
|
|
|
{ |
|
|
|
var xaml = @"
|
|
|
|
<Window xmlns='https://github.com/avaloniaui'>
|
|
|
|
<TextBlock> |
|
|
|
Hello World! |
|
|
|
</TextBlock> |
|
|
|
</Window>";
|
|
|
|
|
|
|
|
var window = AvaloniaXamlLoader.Parse<Window>(xaml); |
|
|
|
var textBlock = (TextBlock)window.Content; |
|
|
|
|
|
|
|
Assert.Equal("Hello World!", textBlock.Text); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private class SelectedItemsViewModel : INotifyPropertyChanged |
|
|
|
{ |
|
|
|
public string[] Items { get; set; } |
|
|
|
|