How to use the markupsafe.escape_silent function in MarkupSafe

To help you get started, we’ve selected a few MarkupSafe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github janeczku / calibre-web / vendor / markupsafe / tests.py View on Github external
def test_escape_silent(self):
        assert escape_silent(None) == Markup()
        assert escape(None) == Markup(None)
        assert escape_silent('') == Markup(u'<foo>')
github pallets / markupsafe / tests.py View on Github external
def test_escape_silent(self):
        assert escape_silent(None) == Markup()
        assert escape(None) == Markup(None)
        assert escape_silent('') == Markup(u'<foo>')
github splunk / splunk-ref-pas-test / pas_simulated_users_addon / user-api / lib / markupsafe / tests.py View on Github external
def test_escape_silent(self):
        assert escape_silent(None) == Markup()
        assert escape(None) == Markup(None)
        assert escape_silent('') == Markup(u'<foo>')
github pallets / markupsafe / tests.py View on Github external
def test_escape_silent(self):
        assert escape_silent(None) == Markup()
        assert escape(None) == Markup(None)
        assert escape_silent('') == Markup(u'<foo>')
github graalvm / graaljs / deps / v8_inspector / third_party / markupsafe / markupsafe / tests.py View on Github external
def test_escape_silent(self):
        assert escape_silent(None) == Markup()
        assert escape(None) == Markup(None)
        assert escape_silent('') == Markup(u'<foo>')
github tranquilit / WAPT / lib / site-packages / markupsafe / tests.py View on Github external
def test_escape_silent(self):
        assert escape_silent(None) == Markup()
        assert escape(None) == Markup(None)
        assert escape_silent('') == Markup(u'<foo>')
github libfirm / libfirm / scripts / markupsafe / tests.py View on Github external
def test_escape_silent(self):
        assert escape_silent(None) == Markup()
        assert escape(None) == Markup(None)
        assert escape_silent('') == Markup(u'<foo>')
github mostafa / grest / grest / verbs / index.py View on Github external
missing=0),

            "limit": fields.Int(required=False,
                                validate=lambda lim: lim >= 1 and lim <= 100,
                                missing=QUERY_LIMIT),

            "order_by": fields.Str(required=False,
                                   missing="?")
        }

        (primary, secondary) = validate_models(self)

        query_data = validate_input(__validation_rules__, request)
        skip = query_data.get("skip")
        limit = query_data.get("skip") + query_data.get("limit")
        order_by = escape(query_data.get("order_by"))

        if order_by:
            if order_by.startswith("-"):
                # select property for descending ordering
                order_by_prop = order_by[1:]
            else:
                # select property for ascending ordering
                order_by_prop = order_by

            primary_model_props = primary.model.defined_properties().keys()
            if all([order_by_prop not in primary_model_props,
                    order_by_prop != "?"]):
                raise HTTPException(msg.INVALID_ORDER_PROPERTY, 404)

        total_items = len(primary.model.nodes)
github TurboGears / tg2 / tg / support / paginate.py View on Github external
def _make_tag(template, text, **attrs):
    return Markup(template % (_format_attrs(**attrs), escape(text))) 
github TurboGears / tg2 / tg / flash.py View on Github external
def _get_message(self, payload):
        msg = payload.get('message','')
        if self.allow_html is False:
            msg = escape(msg)
        return msg