diff options
author | Jochen Topf <jochen@topf.org> | 2015-02-27 10:04:55 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2015-02-27 10:04:55 +0100 |
commit | 89fb3c5faa448115d690328c5ce2538831880122 (patch) | |
tree | 7cebace49c6a4ef10e0251a069f9f41d497317b4 /web/public | |
parent | 441dce41853082a062afdfac805421f204b64f34 (diff) | |
download | taginfo-89fb3c5faa448115d690328c5ce2538831880122.tar taginfo-89fb3c5faa448115d690328c5ce2538831880122.tar.gz |
Add rel="nofollow" to project links.
To discourage spam. The links are created from javascript, so search engines
will have a hard time picking them up anyway. Oh well, better safe than sorry.
Diffstat (limited to 'web/public')
-rw-r--r-- | web/public/js/taginfo.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js index c8b7a25..92e7f70 100644 --- a/web/public/js/taginfo.js +++ b/web/public/js/taginfo.js @@ -228,6 +228,14 @@ function link_to_url(url) { ); } +function link_to_url_nofollow(url) { + return link( + encodeURI(url), + html_escape(url.replace(/^http:\/\//, '')), + { target: '_blank', 'class': 'extlink', 'rel': 'nofollow' } + ); +} + function highlight(str, query) { return html_escape(str).replace(new RegExp('(' + html_escape(query) + ')', 'gi'), "<b>$1</b>"); } |