Browse Source

Quick fix srcsetů, hodně malé obrázky nenafoukneme víc, než je potřeba.

master
Jan Černohorský 9 months ago
parent
commit
2a0e90bb96
  1. 2
      src/formatitko/html_generator.py

2
src/formatitko/html_generator.py

@ -205,7 +205,7 @@ class HTMLGenerator(OutputGenerator):
HTMLGenerator(fake_out, self.katexClient, self.imageProcessor).generate(e.content) HTMLGenerator(fake_out, self.katexClient, self.imageProcessor).generate(e.content)
attributes["alt"] = fake_out.getvalue() attributes["alt"] = fake_out.getvalue()
if len(srcset) != 0: if len(srcset) > 1:
attributes["src"] = srcset[-1][0] attributes["src"] = srcset[-1][0]
attributes["srcset"] = ", ".join([" ".join(src) for src in srcset]) attributes["srcset"] = ", ".join([" ".join(src) for src in srcset])
else: else:

Loading…
Cancel
Save