unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.93k stars 725 forks source link

Problems displaying text with line breaks from resources #9425

Open HavenDV opened 2 years ago

HavenDV commented 2 years ago

Current behavior

I think the problem is that xml:space="preserve" in resources is not supported WASM:

image

Expected behavior

UWP:

image

How to reproduce it (as minimally and precisely as possible)

<TextBox
  x:Uid="/EulaView/EulaTextBox"
  IsReadOnly="True"
  TextWrapping="Wrap"
  ScrollViewer.VerticalScrollBarVisibility="Visible"
  />
  <data name="EulaTextBox.Text" xml:space="preserve">
    <value>Sociocultural Research Consultants, LLC End User License Agreement Terms of Use, End User License Agreement, Disclaimer, and Release of Liability Please Read This Document Carefully By using the pages in this site, you agree to these terms and conditions. If you do not agree, you should not use this website or any applications or services contained on, or downloaded from this website. These terms and conditions may be changed or updated from time to time. This Terms of Use, End User License Agreement, Disclaimer, and Release of Liability (“the Agreement”) is a legal agreement between you and Sociocultural Research Consultants, LLC (“SCRC”) for use of this website and any applications or programs contained on, or downloaded from this website. Such applications include, but are not limited to Dedoose, applications, services, solutions, compilations, reports, summaries, other documents, computer software, and associated media and printed materials generated from use of this website (hereinafter collectively referred to as “the Software”). 
 1. Restricted Use of this Product and Disclaimer 
 The Software is designed exclusively for customers of SCRC who have properly subscribed to this service and been specifically authorized in writing by SCRC to access and use the website and the Software. THE MATERIALS, INFORMATION, AND DOCUMENTS CONTAINED IN THE SOFTWARE ARE SOLELY APPLICABLE TO THE AUTHORIZED USERS HOLDING AN APPROVED PASSWORD. 
 2. Software Product License 
 The Software is protected by copyright laws, as well as other intellectual property laws. The Software is licensed, not sold. You may view and use the Software on the terms and conditions specified herein. You may not store, copy, replicate, or otherwise save any portion of the Software. You may not reverse engineer, de-compile, disassemble, modify, translate, make any attempt to discover the source code of the Software, or create derivative works from the Software. The Software is licensed as a single product. Its component parts may not be separated for use on more than one computer. You may not rent, sub-license, or lease the Software. You may not transfer the Software or any rights you may have as a user under this Agreement to another person or entity. </value>
  </data>

Workaround

No response

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

4.4.13

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

17.1 preview 6

Relevant plugins

No response

Anything else we need to know?

No response

jeromelaban commented 2 years ago

This may be a similar issue to https://github.com/unoplatform/uno/issues/9038, though because it's wasm, it's likely because <p> does not take new lines into account by default.