fix JS code example in hooks docs

- when returning format_html `{` (brace) characters must be escaped
- https://docs.python.org/3/library/string.html#format-string-syntax
pull/6697/head
LB 2021-01-13 20:23:09 +10:00 zatwierdzone przez Matt Westcott
rodzic 7fb4d69d92
commit 7737497239
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -423,12 +423,13 @@ Hooks for customising the editing interface for pages and snippets.
js_includes = format_html_join('\n', '<script src="{0}"></script>',
((static(filename),) for filename in js_files)
)
# remember to use double '{{' so they are not parsed as template placeholders
return js_includes + format_html(
"""
<script>
$(function() {
$(function() {{
$('button').raptorize();
});
}});
</script>
"""
)