﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33405	Documentation for template filter 'escapejs' is extremely unclear	Jon Ribbens	Jon Ribbens	"The documentation says:

     Escapes characters for use in JavaScript strings. This does not make the string safe for use in HTML or JavaScript template literals, but does protect you from syntax errors when using templates to generate JavaScript/JSON.

The first sentence is unclear - JavaScript strings ''where''? Inside `on` attributes? Inside `<script>` blocks?

The second sentence appears entirely meaningless, in that the second half seems to contradict the first half. If it doesn't ""make the string safe"", what ''does'' it do? If it ""protects you from syntax errors"" then in what way is it unsafe, and why?

There needs to be an example of what this filter is supposed to be used for, and an explanation of in which circumstances it is unsafe.

(Also the documentation may say it ""does ''not'' make the string safe"" but the code literally does mark the string safe, so...)

As far as I can see it ought to be safe for use in, e.g.:

    <script>
    const thing = '{{ context_str|escapejs }}'

but I can't tell if the documentation is saying you should do this or you definitely shouldn't do this (and if not, why not)."	Cleanup/optimization	closed	Documentation	dev	Normal	fixed		Adam Johnson Jon Ribbens	Ready for checkin	1	0	0	0	0	0
