From bab6aeb45d2a96b4c5a0bbf4704629bd66e421d5 Mon Sep 17 00:00:00 2001 From: Lars Noack Date: Wed, 15 May 2024 14:26:19 +0200 Subject: [PATCH] fix: removed double linebreaks from formated text, plaintext --- music_kraken/objects/formatted_text.py | 7 ++++++- music_kraken/objects/lyrics.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/music_kraken/objects/formatted_text.py b/music_kraken/objects/formatted_text.py index 8f9fc52..99e9ae2 100644 --- a/music_kraken/objects/formatted_text.py +++ b/music_kraken/objects/formatted_text.py @@ -38,8 +38,13 @@ class FormattedText: def markdown(self) -> str: return md(self.html).strip() + @property + def plain(self) -> str: + md = self.markdown + return md.replace("\n\n", "\n") + def __str__(self) -> str: return self.markdown - plaintext = markdown + plaintext = plain diff --git a/music_kraken/objects/lyrics.py b/music_kraken/objects/lyrics.py index 65d550d..788e793 100644 --- a/music_kraken/objects/lyrics.py +++ b/music_kraken/objects/lyrics.py @@ -34,6 +34,6 @@ class Lyrics(OuterProxy): @property def metadata(self) -> Metadata: return Metadata({ - id3Mapping.UNSYNCED_LYRICS: [self.text.markdown] + id3Mapping.UNSYNCED_LYRICS: [self.text.plaintext] })