# HG changeset patch # User neko259 # Date 2016-01-13 22:12:31 # Node ID be8f90acc50a6655910e4a83df91f792124e4cf7 # Parent fd15aa6f7f515e65ce016a384f6eaa81f6a90f29 Show even number of spaces before and after spoiler diff --git a/boards/mdx_neboard.py b/boards/mdx_neboard.py --- a/boards/mdx_neboard.py +++ b/boards/mdx_neboard.py @@ -169,10 +169,10 @@ def render_tag(tag_name, value, options, def render_spoiler(tag_name, value, options, parent, context): text_len = len(value) - pre_spaces = ' ' * max(random.randint(0, text_len // 2), 2) - post_spaces = ' ' * max(random.randint(0, text_len // 2), 2) - return '{}{}{}'.format(pre_spaces, value, - post_spaces) + space_count = random.randint(0, text_len * 2) + side_spaces = ' ' * (space_count // 2) + return '{}{}{}'.format(side_spaces, value, + side_spaces) return quote_element