summaryrefslogtreecommitdiffstats
path: root/docs/index.rst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:10:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:10:54 +0000
commit3b2c8da6b3117ca186e27a7f94fa44b17f6a82ed (patch)
treed8d343b76ef070019c69531e4bd0f0964804e4d4 /docs/index.rst
parentInitial commit. (diff)
downloadmarkupsafe-3b2c8da6b3117ca186e27a7f94fa44b17f6a82ed.tar.xz
markupsafe-3b2c8da6b3117ca186e27a7f94fa44b17f6a82ed.zip
Adding upstream version 2.1.2.upstream/2.1.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--docs/index.rst47
1 files changed, 47 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..5c45e64
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,47 @@
+.. currentmodule:: markupsafe
+
+MarkupSafe
+==========
+
+MarkupSafe escapes characters so text is safe to use in HTML and XML.
+Characters that have special meanings are replaced so that they display
+as the actual characters. This mitigates injection attacks, meaning
+untrusted user input can safely be displayed on a page.
+
+The :func:`escape` function escapes text and returns a :class:`Markup`
+object. The object won't be escaped anymore, but any text that is used
+with it will be, ensuring that the result remains safe to use in HTML.
+
+>>> from markupsafe import escape
+>>> hello = escape("<em>Hello</em>")
+>>> hello
+Markup('&lt;em&gt;Hello&lt;/em&gt;')
+>>> escape(hello)
+Markup('&lt;em&gt;Hello&lt;/em&gt;')
+>>> hello + " <strong>World</strong>"
+Markup('&lt;em&gt;Hello&lt;/em&gt; &lt;strong&gt;World&lt;/strong&gt;')
+
+
+Installing
+----------
+
+Install and update using `pip`_:
+
+.. code-block:: text
+
+ pip install -U MarkupSafe
+
+.. _pip: https://pip.pypa.io/en/stable/quickstart/
+
+
+Table of Contents
+-----------------
+
+.. toctree::
+ :maxdepth: 2
+
+ escaping
+ html
+ formatting
+ license
+ changes