From c8f312e89dbd300906dc03bb24c92fc7481c193a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Fri, 15 Dec 2023 20:39:09 +0100 Subject: [PATCH] parsers/xhtml: keep iterating on all bodies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert part of b522eaf7f385d17dd4073a583cca96e0590175e6. Signed-off-by: Maxime “pep” Buquet --- parsers/src/xhtml.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parsers/src/xhtml.rs b/parsers/src/xhtml.rs index 26580648..dbda3971 100644 --- a/parsers/src/xhtml.rs +++ b/parsers/src/xhtml.rs @@ -26,7 +26,7 @@ impl XhtmlIm { pub fn into_html(self) -> String { let mut html = Vec::new(); // TODO: use the best language instead. - if let Some((lang, body)) = self.bodies.into_iter().next() { + for (lang, body) in self.bodies { if lang.is_empty() { assert!(body.xml_lang.is_none()); } else { @@ -35,6 +35,7 @@ impl XhtmlIm { for tag in body.children { html.push(tag.into_html()); } + break; } html.concat() }