diff --git a/generator.py b/generator.py index f33576b..fd2dcc4 100755 --- a/generator.py +++ b/generator.py @@ -19,7 +19,7 @@ def fromunixtime(value): return datetime.fromtimestamp(value).strftime('%Y-%m-%d %H:%M:%S') def url_replacer(value): - return value.replace('/', '_').replace(' ', '_').replace('?', '').replace('<', '').replace('>', '') + return re.sub('[^a-zA-Z0-9\n\.]', '_', value) def user_replacer(match): return '[url=../../user/' + url_replacer(match.group(2)) + '.html]' + match.group(2) + '[/url]'