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.
This commit is contained in:
David Wendt 2020-06-10 18:57:11 -04:00
parent 9e56f10fd0
commit 1966ec5cb1
1 changed files with 7 additions and 2 deletions

View File

@ -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