diff --git a/docs/quickstart.rst b/docs/quickstart.rst index f763bb1e..dde45728 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -139,18 +139,16 @@ how you're using untrusted data. .. code-block:: python + from flask import request from markupsafe import escape - @app.route("/") - def hello(name): + @app.route("/hello") + def hello(): + name = request.args.get("name", "Flask") return f"Hello, {escape(name)}!" -If a user managed to submit the name ````, -escaping causes it to be rendered as text, rather than running the -script in the user's browser. - -```` in the route captures a value from the URL and passes it to -the view function. These variable rules are explained below. +If a user submits ``/hello?name=``, escaping causes +it to be rendered as text, rather than running the script in the user's browser. Routing