Escape titles for catalogue in PDF.
authorRadek Czajka <rczajka@rczajka.pl>
Tue, 3 Nov 2026 12:43:36 +0000 (13:43 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Tue, 3 Nov 2026 12:43:36 +0000 (13:43 +0100)
src/catalogue/templatetags/catalogue_tags.py

index e50ab58..2901975 100644 (file)
@@ -164,7 +164,7 @@ def book_tree_texml(book_list, books_by_parent, depth=1):
             %(children)s
             """ % {
                 "depth": depth,
             %(children)s
             """ % {
                 "depth": depth,
-                "title": book.title,
+                "title": book.title.replace('&', '&amp;').replace('<', '&lt;'),
                 "audiences": ", ".join(book.audiences_pl()),
                 "audiobook": "audiobook" if book.has_media('mp3') else "",
                 "children": book_tree_texml(books_by_parent.get(book.id, ()), books_by_parent, depth + 1)
                 "audiences": ", ".join(book.audiences_pl()),
                 "audiobook": "audiobook" if book.has_media('mp3') else "",
                 "children": book_tree_texml(books_by_parent.get(book.id, ()), books_by_parent, depth + 1)