Skip to content
Permalink
Browse files

irclogs clickable links

The links are untrusted, so nofollow.
  • Loading branch information
da2x committed May 15, 2015
1 parent 9cbfa5e commit 9415e149500a588c521aebac1d81ff04bdb7e9fc
Showing with 3 additions and 0 deletions.
  1. +3 −0 v7/irclogs/irclogs.py
@@ -37,6 +37,7 @@

import os
import io
import re
import pygments
import pygments.lexers

@@ -59,5 +60,7 @@ def compile_html(self, source, dest, is_two_file=True):

formatter = NikolaPygmentsHTML('irclog', linenos=False)
data = pygments.highlight(data, lexer, formatter)
link_matcher = re.compile(r"(http[s]?://[^ ]+)")
data = link_matcher.sub(r'<a href="\1" rel="nofollow">\1</a>', data)
out_file.write(data)
return True

0 comments on commit 9415e14

Please sign in to comment.
You can’t perform that action at this time.