summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spoiler.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/spoiler.py b/spoiler.py
index ff762ef..a2c1397 100644
--- a/spoiler.py
+++ b/spoiler.py
@@ -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(