maui
maui copied to clipboard
Label TextType="Html" Crash in Windows if html is "Broken"
Description
Label TextType="Html" Crash in Windows if html "Is Broken" .
Same Html works in IOS and Android
How to check the Broken Html Before ?
<Label TextType="Html" Text="{Binding Item.Description}" VerticalOptions="Center" HorizontalOptions="Center" />
Steps to Reproduce
Link to public reproduction project repository
dont have
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows
Did you find any workaround?
No response
Relevant log output
-
Hi @lucianparvu. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Could you share the broken html used?
I tried to display description of an product inserted in DB by a web app using some html editor .
Link : https://github.com/lucianparvu/Files/blob/67ab161399e8333f67f4c9ad7bce86def02da8b7/BrokenHtml
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
This fix works for html strings that have https with a ? mark in them. It simply removes everything after ? mark so it can render. This fixes a small issue for me that allows the page to render by ignoring invalid data in links.
public static string RemoveBADHtmlTags(string HTMLCode)
{
HTMLCode = Regex.Replace(HTMLCode, "/\\?.*?.\"", "\"", RegexOptions.IgnoreCase | RegexOptions.Singleline);
return HTMLCode;
}