diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 3f76772ab..2d601fbb0 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -109,6 +109,7 @@ class SongBeamerImport(SongImport): self.parse_tags(line) elif line.startswith(u'---'): if self.current_verse: + self.replace_html_tags() self.add_verse(self.current_verse, self.current_verse_type) self.current_verse = u'' @@ -123,12 +124,41 @@ class SongBeamerImport(SongImport): else: self.current_verse += u'%s\n' % line if self.current_verse: + self.replace_html_tags() self.add_verse(self.current_verse, self.current_verse_type) self.finish() self.import_wizard.incrementProgressBar( "Importing %s" % (self.file_name)) return True + def replace_html_tags(self): + """ + This can be called to replace SongBeamer's specific (html) tags with + OpenLP's specific (html) tags. + """ + tag_pairs = [ + (u'', u'{st}'), + (u'', u'{/st}'), + (u'', u'{it}'), + (u'', u'{/it}'), + (u'', u''), + (u'', u''), + (u'
', u'{st}'), + (u'
', u'{st}'), + (u'', u'{st}'), + (u'

', u'{/p}'), + (u'

', u'{/p}'), + (u'', u'{su}'), + (u'', u'{/su}'), + (u'', u'{sb}'), + (u'', u'{/sb}'), + (u'', u''), + (u'', u'') + ] + for pair in tag_pairs: + self.current_verse.replace(pair[0], pair[1]) + # TODO: check for unsupported tags (see wiki) and remove them as well. + def parse_tags(self, line): """ Parses a meta data line.