xamarin/Xamarin.Forms
[Bug] Label.Text comments not allowed after the first non-whitespace character.
Open
#8,857 opened on Dec 11, 2019
a/Xaml </>a/labele/4 :clock4:help wantedt/bug :bug:up-for-grabs
Repository metrics
- Stars
- (5,644 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
Description
<Label.Text> tag does not allow comments after the first non-whitespace character
Steps to Reproduce
- Clone repository here: https://github.com/jcummings2/LabelTextBug
- Try to build project
Alternately, you may also change any existing Label in a project to use the <Label.Text> tag like so:
<Label>
<Label.Text>
Text can go here but you can't add a comment after it
<!-- Comment not allowed after first non-whitespace character -->
</Label.Text>
</Label>
Expected Behavior
All comments should be ignored, regardless of where they occur.
Actual Behavior
XAML does not compile if there is a comment after the first non-whitespace character. The errors are:
- On mac: Error: Specified cast is not valid.
- On windows: Unable to cast object of type 'Xamarin.Forms.Xaml.ListNode' to type 'Xamarin.Forms.Xaml.IElementNode'.
Basic Information
- Version with issue: 4.3.0.908675 (latest as of this writing)
- Last known good version: ?
- IDE: VS Pro for Mac 8.4 (Build 2535) and VS Pro for Windows 16.4.0
- Platform Target Frameworks:
- iOS: 8.0
- Android: 9.0
- Android Support Library Version: N/A
- Nuget Packages: N/A
- Affected Devices: N/A never gets that far
Screenshots
N/A
Reproduction Link
https://github.com/jcummings2/LabelTextBug/blob/master/LabelTextBug/MainPage.xaml#L6