From 1966ec5cb16438c18bc3015134af4606bb98522b Mon Sep 17 00:00:00 2001 From: David Wendt Date: Wed, 10 Jun 2020 18:57:11 -0400 Subject: [PATCH] Implement `sbr` tags. No, I don't know what they are either, but at least one movie exists which treats them like `br`, so we'll treat them like that, too. --- core/src/html/text_format.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/html/text_format.rs b/core/src/html/text_format.rs index b572ca883..9d6afb1a8 100644 --- a/core/src/html/text_format.rs +++ b/core/src/html/text_format.rs @@ -1149,10 +1149,15 @@ impl FormatSpans { for step in tree.as_node().walk().unwrap() { match step { - Step::In(node) if node.tag_name().unwrap().node_name().as_str() == "br" => { + Step::In(node) + if node.tag_name().unwrap().node_name().as_str() == "br" + || node.tag_name().unwrap().node_name().as_str() == "sbr" => + { self.replace_text(self.text.len(), self.text.len(), "\n", format_stack.last()); } - Step::Out(node) if node.tag_name().unwrap().node_name().as_str() == "br" => {} + Step::Out(node) + if node.tag_name().unwrap().node_name().as_str() == "br" + || node.tag_name().unwrap().node_name().as_str() == "sbr" => {} Step::In(node) => format_stack.push(TextFormat::from_presentational_markup( node, format_stack