Merge branch 'openLyrics-whitespaces' into 'master'

Fix trimming leading whitespaces

Closes #1534

See merge request openlp/openlp!659
This commit is contained in:
Raoul Snyman 2023-10-10 23:53:41 +00:00
commit 6d1c598f39
3 changed files with 5 additions and 2 deletions

View File

@ -94,6 +94,8 @@ class OpenLyricsImport(SongImport):
elem.text = elem.text.strip()
if elem.tail is not None and not is_chord_after_tail:
elem.tail = elem.tail.strip()
if elem.tail is not None and elem.tail.startswith('\n'):
elem.tail = elem.tail.lstrip()
else:
has_children = bool(elem.getchildren())
if elem.text is not None:

View File

@ -12,7 +12,8 @@
<lyrics>
<verse name="v1">
<lines>
The <chord name="C"/>Amazing <chord name="C7"/>grace, how s<chord name="F"/>weet the s<chord name="Fm"/>ound<br/>That <chord name="C"/>saved a <chord name="Am7"/>wretch like<chord name="D"/> me!
The <chord name="C"/>Amazing <chord name="C7"/>grace, how s<chord name="F"/>weet the s<chord name="Fm"/>ound<br/>That <chord name="C"/>saved a <chord name="Am7"/>wretch like<chord name="D"/> me!<br/>
That saved a wretch like <chord name="G/C"/>me.
</lines>
</verse>
</lyrics>

View File

@ -1 +1 @@
<song xmlns="http://openlyrics.info/namespace/2009/song" version="0.8" createdIn="OpenLP 2.9.5" modifiedIn="MyApp 0.0.1" modifiedDate="2022-12-12T00:01:00+10:00"><properties><titles><title>Amazing Grace</title></titles></properties><lyrics><verse name="v1"><lines>The <chord name="C"/>Amazing <chord name="C7"/>grace, how s<chord name="F"/>weet the s<chord name="Fm"/>ound<br/>That <chord name="C"/>saved a <chord name="Am7"/>wretch like<chord name="D"/> me!</lines></verse></lyrics></song>
<song xmlns="http://openlyrics.info/namespace/2009/song" version="0.8" createdIn="OpenLP 2.9.5" modifiedIn="MyApp 0.0.1" modifiedDate="2022-12-12T00:01:00+10:00"><properties><titles><title>Amazing Grace</title></titles></properties><lyrics><verse name="v1"><lines>The <chord name="C"/>Amazing <chord name="C7"/>grace, how s<chord name="F"/>weet the s<chord name="Fm"/>ound<br/>That <chord name="C"/>saved a <chord name="Am7"/>wretch like<chord name="D"/> me!<br/>That saved a wretch like <chord name="G/C"/>me.</lines></verse></lyrics></song>