X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/3a0c83394d5783715fab2be29fa1a9cfc3574e28..23d025c8875cca1404f274aca7170c9db5e980e7:/src/librarian/elements/poetry/wers_wciety.py diff --git a/src/librarian/elements/poetry/wers_wciety.py b/src/librarian/elements/poetry/wers_wciety.py index 8fbd175..cb5f25e 100644 --- a/src/librarian/elements/poetry/wers_wciety.py +++ b/src/librarian/elements/poetry/wers_wciety.py @@ -5,24 +5,26 @@ from .wers import Wers class WersWciety(Wers): + HTML_CLASS = Wers.HTML_CLASS + ' verse-indent' + @property def typ(self): v = self.attrib.get('typ') return int(v) if v else 1 - def _txt_build_inner(self, builder): + def txt_build_inner(self, builder): ## Temporary legacy compatibility fix. typ = min(self.typ, 2) builder.push_text(' ' * self.typ, prepared=True) - super(WersWciety, self)._txt_build_inner(builder) + super().txt_build_inner(builder) def get_html_attr(self, builder): - attr = super(WersWciety, self).get_html_attr(builder) - attr['style'] = "padding-left: {}em".format(self.typ) + attr = super().get_html_attr(builder) + attr['class'] += f" verse-indent-{self.typ}" return attr def get_epub_attr(self, builder): - attr = super(WersWciety, self).get_html_attr(builder) + attr = super().get_html_attr(builder) attr['style'] = "margin-left: {}em".format(self.typ) return attr