Drop lots of legacy code. Support Python 3.7-3.11.
[librarian.git] / src / librarian / elements / styles / tytul_dziela.py
1 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
3 #
4 from ..base import WLElement
5
6
7 class TytulDziela(WLElement):
8     EPUB_TAG = HTML_TAG = 'em'
9     EPUB_CLASS = HTML_CLASS = 'book-title'
10
11     def normalize_text(self, text, builder):
12         txt = super(TytulDziela, self).normalize_text(text, builder)
13         if self.attrib.get('typ') == '1':
14             txt = '„{txt}”'.format(txt=txt)
15         return txt