Since we cannot parse `<br>` properly yet, replace them and `<sbr>` with newlines before parsing so that we don't get spurious parse errors.

This commit is contained in:
David Wendt 2020-06-22 18:00:51 -04:00
parent 7a9796a2f9
commit 40ea58c1c0
1 changed files with 6 additions and 1 deletions

View File

@ -115,7 +115,12 @@ pub fn set_html_text<'gc>(
if let Some(display_object) = this.as_display_object() { if let Some(display_object) = this.as_display_object() {
if let Some(mut text_field) = display_object.as_edit_text() { if let Some(mut text_field) = display_object.as_edit_text() {
if let Some(value) = args.get(0) { if let Some(value) = args.get(0) {
let html_string = value.clone().coerce_to_string(avm, context)?.into_owned(); let html_string = value
.clone()
.coerce_to_string(avm, context)?
.into_owned()
.replace("<sbr>", "\n")
.replace("<br>", "\n");
let document = XMLDocument::new(context.gc_context); let document = XMLDocument::new(context.gc_context);
if let Err(err) = if let Err(err) =