WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

MarkdownTextBlock not rendering HTML codes

Open savian-net opened this issue 1 year ago • 3 comments

Describe the bug

HTML hex codes are not being rendered when using x:Bind in MarkdownTextBlock.

Regression

No response

Reproducible in sample app?

  • [ ] This bug can be reproduced in the sample app.

Steps to reproduce

Code: 

<controls:MarkdownTextBlock x:Name="HomePageOverview" Grid.Column="0" Text="a Microsoft&#xAE; environment"/>

Renders the HTML code as a Copyright symbol.

<controls:MarkdownTextBlock x:Name="HomePageOverview" Grid.Column="0" Text="{x:Bind OverviewText}"/>
....
Code behind:

OverviewText = "a Microsoft&#xAE; environment";

And bind the same raw text, it does not render the copyright symbol.

Expected behavior

HTML codes should be rendered when bound from code-behind. HTML tags should also be interpreted correctly (like

). Instead, raw text is displayed vs being rendered.

Screenshots

No response

Windows Build Number

  • [ ] Windows 10 1809 (Build 17763)
  • [ ] Windows 10 1903 (Build 18362)
  • [ ] Windows 10 1909 (Build 18363)
  • [ ] Windows 10 2004 (Build 19041)
  • [ ] Windows 10 20H2 (Build 19042)
  • [ ] Windows 10 21H1 (Build 19043)
  • [X] Windows 11 21H2 (Build 22000)
  • [ ] Other (specify)

Other Windows Build number

No response

App minimum and target SDK version

  • [X] Windows 10, version 1809 (Build 17763)
  • [ ] Windows 10, version 1903 (Build 18362)
  • [ ] Windows 10, version 1909 (Build 18363)
  • [ ] Windows 10, version 2004 (Build 19041)
  • [ ] Other (specify)

Other SDK version

No response

Visual Studio Version

2022

Visual Studio Build Number

No response

Device form factor

Desktop

Nuget packages

<PackageReference Include="CommunityToolkit.WinUI.UI.Controls.Markdown" Version="7.1.2" />

Additional context

No response

Help us help you

No.

savian-net avatar Dec 01 '22 05:12 savian-net