|
|
|
@ -87,7 +87,10 @@ def slimdown(text):
|
|
|
|
|
i_pattern = re.compile(r"(\*)(.*?)\1") |
|
|
|
|
u_pattern = re.compile(r"(__)(.*?)\1") |
|
|
|
|
|
|
|
|
|
text, n = re.subn(b_pattern, "<b>\\2</b>", text) |
|
|
|
|
text, n = re.subn(i_pattern, "<i>\\2</i>", text) |
|
|
|
|
text, n = re.subn(u_pattern, "<u>\\2</u>", text) |
|
|
|
|
return mark_safe(text) |
|
|
|
|
if text: |
|
|
|
|
text, n = re.subn(b_pattern, "<b>\\2</b>", text) |
|
|
|
|
text, n = re.subn(i_pattern, "<i>\\2</i>", text) |
|
|
|
|
text, n = re.subn(u_pattern, "<u>\\2</u>", text) |
|
|
|
|
return mark_safe(text) |
|
|
|
|
else: |
|
|
|
|
return "" |
|
|
|
|