Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions prismic/fragments.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)

from collections import namedtuple, defaultdict, OrderedDict
from html import escape
import logging
import cgi
import re
import datetime

Expand Down Expand Up @@ -454,7 +454,7 @@ class Text(BasicFragment):

@property
def as_html(self):
return """<span class="text">%s</span>""" % cgi.escape(self.value)
return """<span class="text">%s</span>""" % escape(self.value)

class Date(BasicFragment):

Expand Down Expand Up @@ -744,10 +744,10 @@ def span_as_html(text, spans, link_resolver, html_serializer):
})
if len(stack) == 0:
# Top-level text
html.append(cgi.escape(letter))
html.append(escape(letter))
else:
# Inner text of a span
stack[-1]["content"] += cgi.escape(letter)
stack[-1]["content"] += escape(letter)

# Check for the tags after the end of the string
while len(stack) > 0:
Expand Down