##// END OF EJS Templates
Show even number of spaces before and after spoiler
neko259 -
r1459:be8f90ac default
parent child Browse files
Show More
@@ -169,10 +169,10 b' def render_tag(tag_name, value, options,'
169
169
170 def render_spoiler(tag_name, value, options, parent, context):
170 def render_spoiler(tag_name, value, options, parent, context):
171 text_len = len(value)
171 text_len = len(value)
172 pre_spaces = ' ' * max(random.randint(0, text_len // 2), 2)
172 space_count = random.randint(0, text_len * 2)
173 post_spaces = ' ' * max(random.randint(0, text_len // 2), 2)
173 side_spaces = ' ' * (space_count // 2)
174 return '<span class="spoiler">{}{}{}</span>'.format(pre_spaces, value,
174 return '<span class="spoiler">{}{}{}</span>'.format(side_spaces, value,
175 post_spaces)
175 side_spaces)
176
176
177 return quote_element
177 return quote_element
178
178
General Comments 0
You need to be logged in to leave comments. Login now