All Samples(67) | Call(50) | Derive(0) | Import(17)
Convert the characters &, <, >, ' and " in string s to HTML-safe sequences. Use this if you need to display text that might contain such characters in HTML. Marks return value as markup string.
def escape(s):
"""Convert the characters &, <, >, ' and " in string s to HTML-safe
sequences. Use this if you need to display text that might contain
such characters in HTML. Marks return value as markup string.
"""
if hasattr(s, '__html__'):
return s.__html__()
return Markup(unicode(s)
.replace('&', '&')
.replace('>', '>')
.replace('<', '<')
.replace("'", ''')
.replace('"', '"')
)
"""cloud_sptheme.ext.index_styling - improves css styling for genindex""" import logging; log = logging.getLogger(__name__) import re from jinja2 import Markup as literal, escape
return name
if loc:
loc = literal('<span class="location">') + escape(loc) + literal("</span>")
cat = left + loc + right
return escape(name) + literal('<span class="category ' + type + '">') + escape(cat) + literal("</span>")
src/j/i/jingo-0.6.1/jingo/helpers.py jingo(Download)
string = unicode(string)
args = [jinja2.escape(smart_unicode(v)) for v in args]
for k in kwargs:
kwargs[k] = jinja2.escape(smart_unicode(kwargs[k]))
src/s/t/staticsauce-HEAD/staticsauce/templating.py staticsauce(Download)
return ''.join(
'<p>{p}</p>'.format(p=paragraph.strip())
for paragraph in _re.split(jinja2.escape(value))
)
src/s/t/staticsauce-0.5/staticsauce/templating.py staticsauce(Download)
return ''.join(
'<p>{p}</p>'.format(p=paragraph.strip())
for paragraph in _re.split(jinja2.escape(value))
)
src/m/o/moz-addon-packager-1.0.1/packager/main.py moz-addon-packager(Download)
import uuid from jinja2 import escape, Environment, FunctionLoader RESOURCES_PATH = os.path.join(os.path.dirname(__file__), 'resources')
def escape_all(v):
"""Recursively escape a string, list, or dictionary."""
if isinstance(v, basestring):
v = unicode(escape(decode_utf8(v)))
elif isinstance(v, list):
src/e/a/EasyWidgets-0.2dev-20130116/ew/jinja2_ew.py EasyWidgets(Download)
'''Implementation of core ew widgets in terms of Jinja2 templates ''' from jinja2 import escape from webhelpers.html import literal
pass
if isinstance(s, str):
return escape(unicode(s, 'utf-8'))
else:
return escape(s)
src/n/e/Nereid-2.6.0.2/nereid/__init__.py Nereid(Download)
# in the module but are exported as public interface. from werkzeug import abort, redirect from jinja2 import Markup, escape from flask.globals import current_app, g, request, \
src/f/l/Flask-0.9/flask/__init__.py Flask(Download)
from werkzeug.exceptions import abort from werkzeug.utils import redirect from jinja2 import Markup, escape from .app import Flask, Request, Response
src/k/a/kalapy-HEAD/kalapy/web/__init__.py kalapy(Download)
from werkzeug.exceptions import HTTPException, NotFound from werkzeug.contrib.securecookie import SecureCookie from jinja2 import Markup, escape from kalapy.web.local import *
src/k/a/KalaPy-0.4.2/kalapy/web/__init__.py KalaPy(Download)
from werkzeug.exceptions import HTTPException, NotFound from werkzeug.contrib.securecookie import SecureCookie from jinja2 import Markup, escape from kalapy.web.local import *
1 | 2 Next