diff options
author | Botond Hende <nettingman@gmail.com> | 2024-09-22 21:03:39 +0200 |
---|---|---|
committer | Botond Hende <nettingman@gmail.com> | 2024-09-22 21:03:39 +0200 |
commit | 0e4fe058953c53278a28de7605a7e40ec7f778b0 (patch) | |
tree | 983d5eabdf5852c56ad9a675563e13f863f29bc1 /spoiler.py | |
parent | 172401092bc5bb1ec309031f9b61e72e47e52961 (diff) |
Diffstat (limited to 'spoiler.py')
-rw-r--r-- | spoiler.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -25,7 +25,7 @@ class SpoilerElement(inline.InlineElement): class SpoilerRenderer: def render_spoiler_element(self, element: SpoilerElement): content = self.render_children(element) - return f'<span><input type="checkbox" class="spoiler" id="{element.id}"><label class="spoiler-on" for="{element.id}"><span>{"▉" * len(unescape(content))}</span></label><label class="spoiler-off" for="{element.id}"><span>{content}</span></label></span>' + return f'<span><input type="checkbox" class="spoiler" id="{element.id}"><label class="spoiler-on" for="{element.id}"><span>{"".join(["▉" if char != " " else " " for char in unescape(content)])}</span></label><label class="spoiler-off" for="{element.id}"><span>{content}</span></label></span>' Spoiler = MarkoExtension( |