Skip to content

Commit

Permalink
html: Restore handling of "sbr" tags
Browse files Browse the repository at this point in the history
This partially reverts commit 2119ce9,
only restoring "sbr" tags handling because Flash seems to ignore only
"br" tags.
  • Loading branch information
relrelb committed Nov 13, 2021
1 parent 2119ce9 commit df514f3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/html/text_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,15 @@ impl FormatSpans {
};
let mut format = format_stack.last().unwrap().clone();
match &e.name().to_ascii_lowercase()[..] {
b"sbr" => {
text.push('\n');
if let Some(span) = spans.last_mut() {
span.span_length += 1;
}

// Skip push to `format_stack`.
continue;
}
b"p" => match attribute(b"align").as_deref() {
Some(b"left") => format.align = Some(swf::TextAlign::Left),
Some(b"center") => format.align = Some(swf::TextAlign::Center),
Expand Down Expand Up @@ -698,6 +707,10 @@ impl FormatSpans {
}
Ok(Event::End(e)) => {
match &e.name().to_ascii_lowercase()[..] {
b"sbr" => {
// Skip pop from `format_stack`.
continue;
}
b"p" | b"li" => {
text.push('\n');
if let Some(span) = spans.last_mut() {
Expand Down

0 comments on commit df514f3

Please sign in to comment.