diff options
| author | Baptiste Mispelon <bmispelon@gmail.com> | 2021-11-19 16:52:57 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-11-22 11:52:19 +0100 |
| commit | e6e664a71130ee74d2c4c6800e4131f132709997 (patch) | |
| tree | 09187decdfad02d9d437b23841c3f0bd218facd6 /docs | |
| parent | dd528cb2cefc0db8b91a7ff0a2bc87305b976597 (diff) | |
Fixed #33302 -- Made element_id optional argument for json_script template filter.
Added versionchanged note in documentation
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 6 | ||||
| -rw-r--r-- | docs/releases/4.1.txt | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 2edfd65c7b..f02a8f61c8 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1832,7 +1832,7 @@ If ``value`` is the list ``['a', 'b', 'c']``, the output will be the string Safely outputs a Python object as JSON, wrapped in a ``<script>`` tag, ready for use with JavaScript. -**Argument:** HTML "id" of the ``<script>`` tag. +**Argument:** The optional HTML "id" of the ``<script>`` tag. For example:: @@ -1861,6 +1861,10 @@ This is compatible with a strict Content Security Policy that prohibits in-page script execution. It also maintains a clean separation between passive data and executable code. +.. versionchanged:: 4.1 + + In older versions, the HTML "id" was a required argument. + .. templatefilter:: last ``last`` diff --git a/docs/releases/4.1.txt b/docs/releases/4.1.txt index 7bfb527104..e8296e4d36 100644 --- a/docs/releases/4.1.txt +++ b/docs/releases/4.1.txt @@ -210,7 +210,8 @@ Signals Templates ~~~~~~~~~ -* ... +* :tfilter:`json_script` template filter now allows wrapping in a ``<script>`` + tag without the HTML ``id`` attribute. Tests ~~~~~ |
