diff --git a/imessage-exporter/src/exporters/html.rs b/imessage-exporter/src/exporters/html.rs
index bce763ba..c37d0005 100644
--- a/imessage-exporter/src/exporters/html.rs
+++ b/imessage-exporter/src/exporters/html.rs
@@ -1029,6 +1029,17 @@ impl<'a> BalloonFormatter<&'a Message> for HTML<'a> {
out_s.push_str("\" ");
}
+ // Add lyrics, if any
+ if let Some(lyrics) = &balloon.lyrics {
+ out_s.push_str("
");
+ for line in lyrics {
+ out_s.push_str("
");
+ out_s.push_str(line);
+ out_s.push_str("
");
+ }
+ out_s.push_str("
");
+ }
+
// Header end
out_s.push_str("");
@@ -2461,6 +2472,7 @@ mod balloon_format_tests {
artist: Some("artist"),
album: Some("album"),
track_name: Some("track_name"),
+ lyrics: None,
};
let expected = exporter.format_music(&balloon, &Config::fake_message());
@@ -2469,6 +2481,28 @@ mod balloon_format_tests {
assert_eq!(expected, actual);
}
+ #[test]
+ fn can_format_html_music_lyrics() {
+ // Create exporter
+ let options = Options::fake_options(crate::app::export_type::ExportType::Html);
+ let config = Config::fake_app(options);
+ let exporter = HTML::new(&config).unwrap();
+
+ let balloon = MusicMessage {
+ url: Some("url"),
+ preview: None,
+ artist: Some("artist"),
+ album: Some("album"),
+ track_name: Some("track_name"),
+ lyrics: Some(vec!["a", "b"]),
+ };
+
+ let expected = exporter.format_music(&balloon, &Config::fake_message());
+ let actual = "