summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/src
diff options
context:
space:
mode:
authorJeremy Chen <jeremy886@gmail.com>2017-04-15 19:23:58 +1000
committerGitHub <noreply@github.com>2017-04-15 19:23:58 +1000
commit67ac6c8718df02505882d08d254d7a4ab9423d18 (patch)
tree30ce392aebe692efb029fe2f82b9c85bfef88181 /docs/tutorials/wiki2/src
parentbcde632349de081880ce4fe49982defb832a030c (diff)
downloadpyramid-67ac6c8718df02505882d08d254d7a4ab9423d18.tar.gz
pyramid-67ac6c8718df02505882d08d254d7a4ab9423d18.tar.bz2
pyramid-67ac6c8718df02505882d08d254d7a4ab9423d18.zip
Update default.py
Diffstat (limited to 'docs/tutorials/wiki2/src')
-rw-r--r--docs/tutorials/wiki2/src/views/tutorial/views/default.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/tutorials/wiki2/src/views/tutorial/views/default.py b/docs/tutorials/wiki2/src/views/tutorial/views/default.py
index 0a05b33e6..3b95e0f59 100644
--- a/docs/tutorials/wiki2/src/views/tutorial/views/default.py
+++ b/docs/tutorials/wiki2/src/views/tutorial/views/default.py
@@ -1,4 +1,4 @@
-import html
+from pyramid.compat import escape
import re
from docutils.core import publish_parts
@@ -31,10 +31,10 @@ def view_page(request):
exists = request.dbsession.query(Page).filter_by(name=word).all()
if exists:
view_url = request.route_url('view_page', pagename=word)
- return '<a href="%s">%s</a>' % (view_url, html.escape(word))
+ return '<a href="%s">%s</a>' % (view_url, escape(word))
else:
add_url = request.route_url('add_page', pagename=word)
- return '<a href="%s">%s</a>' % (add_url, html.escape(word))
+ return '<a href="%s">%s</a>' % (add_url, escape(word))
content = publish_parts(page.data, writer_name='html')['html_body']
content = wikiwords.sub(add_link, content)