diff options
author | David Lord <davidism@gmail.com> | 2020-01-29 20:13:47 -0800 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2020-01-29 22:20:44 -0800 |
commit | 337a79f8caeff25422b28771e851c140d5d744ac (patch) | |
tree | 42bb52efe6a579da35ef8869dc972d56120e9f5d /README.rst | |
parent | 89b18c5949ecb6b67badda90f5e01895eabc6aa3 (diff) | |
download | markupsafe-337a79f8caeff25422b28771e851c140d5d744ac.tar.gz |
apply pyupgrade
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -27,17 +27,17 @@ Examples >>> from markupsafe import Markup, escape >>> # escape replaces special characters and wraps in Markup - >>> escape('<script>alert(document.cookie);</script>') + >>> escape("<script>alert(document.cookie);</script>") Markup(u'<script>alert(document.cookie);</script>') >>> # wrap in Markup to mark text "safe" and prevent escaping - >>> Markup('<strong>Hello</strong>') + >>> Markup("<strong>Hello</strong>") Markup('<strong>hello</strong>') - >>> escape(Markup('<strong>Hello</strong>')) + >>> escape(Markup("<strong>Hello</strong>")) Markup('<strong>hello</strong>') - >>> # Markup is a text subclass (str on Python 3, unicode on Python 2) + >>> # Markup is a str subclass >>> # methods and operators escape their arguments >>> template = Markup("Hello <em>%s</em>") - >>> template % '"World"' + >>> template % ('"World"',) Markup('Hello <em>"World"</em>') |