From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id B6D491F83C for ; Fri, 4 Jan 2019 13:59:45 +0000 (UTC) From: Eric Wong To: Subject: [PATCH] linkify source commands and URLs Date: Fri, 4 Jan 2019 13:59:45 +0000 Message-Id: <20190104135945.6339-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: It's common to have gitweb and cgit URLs which are viewable in the browser AND clonable. So add links to encourage follows. --- lib/oldweb/_tail.rhtml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/oldweb/_tail.rhtml b/lib/oldweb/_tail.rhtml index 14fc5a8..e3fada5 100644 --- a/lib/oldweb/_tail.rhtml +++ b/lib/oldweb/_tail.rhtml @@ -22,8 +22,11 @@ href="mailto:<%= private_email %>"><%= private_email %><% end if url_or_cmd = source_code.shift + url_or_cmd = url_or_cmd.sub(%r{\b(https?://\S+)}, "\\1") %> source code: <%= url_or_cmd %> -<% source_code.each do |x| %><%= "\t#{x}" %><% end +<% source_code.each do |x| %><%= + %Q{\t#{x.sub(%r{\b(https?://\S+)}, %Q{\\1})}} +%><% end end %><% end %> -- EW