feat: improved the lyrics support for bandcamp
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -1,18 +1,26 @@
|
||||
import mistune
|
||||
import html2markdown
|
||||
|
||||
|
||||
def plain_to_markdown(plain: str) -> str:
|
||||
return plain.replace("\n", " \n")
|
||||
|
||||
|
||||
class FormattedText:
|
||||
html = ""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
markdown: str = None,
|
||||
html: str = None
|
||||
html: str = None,
|
||||
plain: str = None,
|
||||
) -> None:
|
||||
if html is not None:
|
||||
self.html = html
|
||||
elif markdown is not None:
|
||||
self.html = mistune.markdown(markdown)
|
||||
elif plain is not None:
|
||||
self.html = mistune.markdown(plain_to_markdown(plain))
|
||||
|
||||
@property
|
||||
def is_empty(self) -> bool:
|
||||
|
Reference in New Issue
Block a user