forked from openlp/openlp
Use html.escape instead of the deprecated cgi.escape
This commit is contained in:
parent
f8b575065a
commit
589bc98bec
|
@ -29,7 +29,7 @@ Some of the code for this form is based on the examples at:
|
|||
|
||||
"""
|
||||
|
||||
import cgi
|
||||
import html
|
||||
import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL
|
||||
|
@ -273,7 +273,7 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties):
|
|||
"""
|
||||
# First we convert <>& marks to html variants, then apply
|
||||
# formattingtags, finally we double all backslashes for JavaScript.
|
||||
text_prepared = expand_tags(cgi.escape(text)).replace('\\', '\\\\').replace('\"', '\\\"')
|
||||
text_prepared = expand_tags(html.escape(text)).replace('\\', '\\\\').replace('\"', '\\\"')
|
||||
if self.height() != self.screen['size'].height() or not self.isVisible():
|
||||
shrink = True
|
||||
js = 'show_alert("%s", "%s")' % (text_prepared, 'top')
|
||||
|
|
|
@ -55,7 +55,7 @@ The XML of an `OpenLyrics <http://openlyrics.info/>`_ song looks like this::
|
|||
</lyrics>
|
||||
</song>
|
||||
"""
|
||||
import cgi
|
||||
import html
|
||||
import logging
|
||||
import re
|
||||
|
||||
|
@ -318,7 +318,7 @@ class OpenLyrics(object):
|
|||
if 'lang' in verse[0]:
|
||||
verse_element.set('lang', verse[0]['lang'])
|
||||
# Create a list with all "optional" verses.
|
||||
optional_verses = cgi.escape(verse[1])
|
||||
optional_verses = html.escape(verse[1])
|
||||
optional_verses = optional_verses.split('\n[---]\n')
|
||||
start_tags = ''
|
||||
end_tags = ''
|
||||
|
|
Loading…
Reference in New Issue