parsers/xhtml: keep iterating on all bodies

Maxime “pep” Buquet created

Revert part of b522eaf7f385d17dd4073a583cca96e0590175e6.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>

Change summary

parsers/src/xhtml.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Detailed changes

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()
     }