Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def rend(txt):
- out = bottle.html_escape(txt)
- r1 = re.compile(r"(\b(http|https)://([-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|]))")
- out = r1.sub(r'<a href="\1">\1</a>',out)
- out=out.split("\n")
- rr=re.compile("^(>){1,6}")
- for i in range(0,len(out)):
- if(re.match(rr,out[i])):
- out[i]="<font color='green'>"+out[i]+"</font>"
- out = ''.join(i+"\n" for i in out)
- r2 = re.compile(r"(\b(ii)://([-A-Za-z0-9+&@#/%?=~_()|!:,.;]*[-A-Za-z0-9+&@#/%=~_()|]))")
- out = r2.sub(r'<a href="\3"><span class="success radius label">\3</span></a>',out)
- return out.replace('\n', '<br />')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement