forked from openlp/openlp
remove strike tags in songBeamer files; decent check for digits
This commit is contained in:
parent
7889a22810
commit
3a13ebdce7
@ -153,7 +153,9 @@ class SongBeamerImport(SongImport):
|
|||||||
(u'<sub>', u'{sb}'),
|
(u'<sub>', u'{sb}'),
|
||||||
(u'</sub>', u'{/sb}'),
|
(u'</sub>', u'{/sb}'),
|
||||||
(u'<wordwrap>', u''),
|
(u'<wordwrap>', u''),
|
||||||
(u'</wordwrap>', u'')
|
(u'</wordwrap>', u''),
|
||||||
|
(u'<strike>', u''),
|
||||||
|
(u'</strike>', u'')
|
||||||
]
|
]
|
||||||
for pair in tag_pairs:
|
for pair in tag_pairs:
|
||||||
self.current_verse = self.current_verse.replace(pair[0], pair[1])
|
self.current_verse = self.current_verse.replace(pair[0], pair[1])
|
||||||
@ -264,8 +266,8 @@ class SongBeamerImport(SongImport):
|
|||||||
|
|
||||||
def check_verse_marks(self, line):
|
def check_verse_marks(self, line):
|
||||||
"""
|
"""
|
||||||
Check and add the verse's MarkType. Returns ``True`` if the given mark
|
Check and add the verse's MarkType. Returns ``True`` if the given line
|
||||||
is correct otherwise ``False``.
|
contains a correct verse mark otherwise ``False``.
|
||||||
|
|
||||||
``line``
|
``line``
|
||||||
The line to check for marks (unicode).
|
The line to check for marks (unicode).
|
||||||
@ -275,10 +277,8 @@ class SongBeamerImport(SongImport):
|
|||||||
self.current_verse_type = SongBeamerTypes.MarkTypes[marks[0]]
|
self.current_verse_type = SongBeamerTypes.MarkTypes[marks[0]]
|
||||||
if len(marks) == 2:
|
if len(marks) == 2:
|
||||||
# If we have a digit, we append it to current_verse_type.
|
# If we have a digit, we append it to current_verse_type.
|
||||||
try:
|
if marks[1].isdigit():
|
||||||
self.current_verse_type += u'%s' % int(marks[1])
|
self.current_verse_type += marks[1]
|
||||||
except ValueError:
|
|
||||||
pass
|
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user