Did I find the right examples for you? yes no

All Samples(454)  |  Call(318)  |  Derive(0)  |  Import(136)
escape(s) -> markup

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.

src/w/e/webapp2_example-HEAD/lib/jinja2/testsuite/security.py   webapp2_example(Download)
from jinja2.sandbox import SandboxedEnvironment, \
     ImmutableSandboxedEnvironment, unsafe
from jinja2 import Markup, escape
from jinja2.exceptions import SecurityError, TemplateSyntaxError, \
     TemplateRuntimeError
    def test_markup_operations(self):
        # adding two strings should escape the unsafe one
        unsafe = '<script type="application/x-some-script">alert("foo");</script>'
        safe = Markup('<em>username</em>')
        assert unsafe + safe == unicode(escape(unsafe)) + unicode(safe)
 
        # escaping and unescaping
        assert escape('"<>&\'') == '&#34;&lt;&gt;&amp;&#39;'
        assert Markup("<em>Foo &amp; Bar</em>").striptags() == "Foo & Bar"
        assert Markup("&lt;test&gt;").unescape() == "<test>"
        assert t.render() == escaped_out
        assert unicode(t.module) == escaped_out
        assert escape(t.module) == escaped_out
        assert t.module.say_hello('<blink>foo</blink>') == escaped_out
        assert escape(t.module.say_hello('<blink>foo</blink>')) == escaped_out

src/g/a/gae-twitter-oauth-example-HEAD/flask.py   gae-twitter-oauth-example(Download)
# in the module but are exported as public interface.
from werkzeug import abort, redirect
from jinja2 import Markup, escape
 
# use pkg_resource if that works, otherwise fall back to cwd.  The

src/z/a/zamboni-HEAD/apps/users/helpers.py   zamboni(Download)
    # inject junk somewhere
    i = random.randint(0, len(email) - 1)
    fallback = u"%s%s%s" % (jinja2.escape(fallback[:i]),
                            u'<span class="i">null</span>',
                            jinja2.escape(fallback[i:]))
    # replace @ and .
    fallback = fallback.replace('@', '&#x0040;').replace('.', '&#x002E;')
 
    if title:
        title = jinja2.escape(title)
def _user_link(user):
    if isinstance(user, basestring):
        return user
    # Marketplace doesn't have user profile pages.
    return jinja2.escape(smart_unicode(user.name))

src/c/a/captain-HEAD/vendor/lib/python/jingo/helpers.py   captain(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/k/a/kay-HEAD/kay/utils/filters.py   kay(Download)
 
import re
from jinja2 import (
  environmentfilter, Markup, escape,
)
def nl2br(environment, value):
  result = u'<br/>'.join(u'%s' % p.replace('\n', '<br>\n')
                        for p in _paragraph_re.split(escape(value)))
  if environment.autoescape:
    result = Markup(result)

src/f/i/FireCheckIn-HEAD/kay/utils/filters.py   FireCheckIn(Download)
 
import re
from jinja2 import (
  environmentfilter, Markup, escape,
)
def nl2br(environment, value):
  result = u'<br/>'.join(u'%s' % p.replace('\n', '<br>\n')
                        for p in _paragraph_re.split(escape(value)))
  if environment.autoescape:
    result = Markup(result)

src/p/y/pysit-0.5b3/pysit/_sphinx/from_cloud_sptheme/ext/index_styling.py   pysit(Download)
"""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/z/a/zamboni-HEAD/mkt/site/helpers.py   zamboni(Download)
        for p in product.all_previews:
            preview = {
                'fullUrl': jinja2.escape(p.image_url),
                'type': jinja2.escape(p.filetype),
                'thumbUrl': jinja2.escape(p.thumbnail_url),
    wl = ('categories', 'currencies', 'isPurchased', 'is_packaged', 'previews',
          'price', 'priceLocale')
    return dict([k, jinja2.escape(v) if k not in wl else v]
                for k, v in ret.items())
 

src/i/n/intranet-HEAD/src/intranet3/intranet3/lib/times.py   intranet(Download)
import datetime
import copy
 
import xlwt
from jinja2 import escape
    def _print_subrow(self, subrow):
        identifier = '%s_%s' % (subrow[4].id, subrow[2])
        ## for titles ajax fetching
        title = '<span class="ajax_changeable" data-id="%s">%s</span>' % (identifier, escape(subrow[5]))
 
        row = [
            escape(subrow[0].name),
            escape(subrow[1].name),
            subrow[2],
            escape(subrow[3].name),

src/z/a/zamboni-HEAD/apps/addons/buttons.py   zamboni(Download)
def big_install_button(context, addon, **kwargs):
    from addons.helpers import statusflags
    backup = kwargs.pop('show_backup', True)
    flags = jinja2.escape(statusflags(context, addon))
    base = _install_button(context, addon, detailed=True, size='prominent',
def mobile_install_button(context, addon, **kwargs):
    from addons.helpers import statusflags
    b = _install_button(context, addon, detailed=True, size='prominent',
                        mobile=True, **kwargs)
    flags = jinja2.escape(statusflags(context, addon))

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next