forked from openlp/openlp
Remove not supported html from songs being imported.
bzr-revno: 1191
This commit is contained in:
commit
787b4e2a58
@ -27,10 +27,11 @@
|
||||
The :mod:`songbeamerimport` module provides the functionality for importing
|
||||
SongBeamer songs into the OpenLP database.
|
||||
"""
|
||||
import logging
|
||||
import os
|
||||
import chardet
|
||||
import codecs
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
|
||||
from openlp.core.lib import translate
|
||||
from openlp.plugins.songs.lib.songimport import SongImport
|
||||
@ -151,23 +152,25 @@ class SongBeamerImport(SongImport):
|
||||
(u'</i>', u'{/it}'),
|
||||
(u'<u>', u'{u}'),
|
||||
(u'</u>', u'{/u}'),
|
||||
(u'<br>', u'{st}'),
|
||||
(u'</br>', u'{st}'),
|
||||
(u'</ br>', u'{st}'),
|
||||
(u'<p>', u'{p}'),
|
||||
(u'</p>', u'{/p}'),
|
||||
(u'<super>', u'{su}'),
|
||||
(u'</super>', u'{/su}'),
|
||||
(u'<sub>', u'{sb}'),
|
||||
(u'</sub>', u'{/sb}'),
|
||||
(u'<wordwrap>', u''),
|
||||
(u'</wordwrap>', u''),
|
||||
(u'<strike>', u''),
|
||||
(u'</strike>', u'')
|
||||
(u'<[/]?br.*?>', u'{st}'),
|
||||
(u'<[/]?wordwrap>', u''),
|
||||
(u'<[/]?strike>', u''),
|
||||
(u'<[/]?h.*?>', u''),
|
||||
(u'<[/]?s.*?>', u''),
|
||||
(u'<[/]?linespacing.*?>', u''),
|
||||
(u'<[/]?c.*?>', u''),
|
||||
(u'<align.*?>', u''),
|
||||
(u'<valign.*?>', u'')
|
||||
]
|
||||
for pair in tag_pairs:
|
||||
self.current_verse = self.current_verse.replace(pair[0], pair[1])
|
||||
# TODO: check for unsupported tags (see wiki) and remove them as well.
|
||||
self.current_verse = re.compile(pair[0]).sub(pair[1],
|
||||
self.current_verse)
|
||||
|
||||
def parse_tags(self, line):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user