maui icon indicating copy to clipboard operation
maui copied to clipboard

Label TextType="Html" Crash in Windows if html is "Broken"

Open lucianparvu opened this issue 2 years ago • 3 comments

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

-

lucianparvu avatar Nov 12 '22 15:11 lucianparvu

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.

ghost avatar Nov 14 '22 15:11 ghost

Could you share the broken html used?

jsuarezruiz avatar Nov 14 '22 15:11 jsuarezruiz

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

lucianparvu avatar Nov 14 '22 16:11 lucianparvu

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.

ghost avatar Nov 15 '22 19:11 ghost

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;
    }

ne0rrmatrix avatar Feb 16 '23 21:02 ne0rrmatrix