James-Edmunds commited on
Commit
2d21a4c
·
verified ·
1 Parent(s): bd2faef

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -17,10 +17,13 @@ from config.settings import Settings
17
 
18
 
19
  def format_lyrics(text: str) -> str:
20
- """Format lyrics: bold section markers, clean whitespace."""
 
21
  # Bold section markers like [Verse 1], [Chorus], etc.
22
  text = re.sub(r'\[([^\]]+)\]', r'**[\1]**', text)
23
- return text.strip()
 
 
24
 
25
 
26
  def main():
 
17
 
18
 
19
  def format_lyrics(text: str) -> str:
20
+ """Format lyrics: bold section markers, force line breaks."""
21
+ text = text.strip()
22
  # Bold section markers like [Verse 1], [Chorus], etc.
23
  text = re.sub(r'\[([^\]]+)\]', r'**[\1]**', text)
24
+ # Force markdown line breaks: add two trailing spaces before each newline
25
+ text = re.sub(r' *\n', ' \n', text)
26
+ return text
27
 
28
 
29
  def main():