Skip to content

Instantly share code, notes, and snippets.

@vividtone
Created March 17, 2016 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vividtone/4795436465a29540149d to your computer and use it in GitHub Desktop.
Save vividtone/4795436465a29540149d to your computer and use it in GitHub Desktop.
Redmineで file:// で始まるURLがリンクとして表示されるようにする
/*
* RedmineのチケットやWikiで file:// で始まるURLをリンクとして
* 表示する。
*
* 【使い方】
* 使用しているテーマの javascripts/theme.js にこのコードを追記する。
*
* 【備考】
* Redmineで file:// がリンクにならないのは仕様。
*
* Feature #7370: Interpret "file://" into issue description
* http://www.redmine.org/issues/7370
*
*/
$(function(){
$('.wiki').each(function() {
var doc = $(this).html();
$(this).html(
doc.replace(/(file:\/\/[^\s<]*)/g, '<a href="$1">$1</a>')
);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment